Layout

    Naively, this means we just want this design:

    As we saw in the ownership chapter, we should use Unique<T> in place of when we have a raw pointer to an allocation we own. Unique is unstable,so we’d like to not use it if possible, though.

    We can implement all of the above requirements except for the lastone in stable Rust:

    If you don’t care about the null-pointer optimization, then you can use thestable code. However we will be designing the rest of the code around enablingthis optimization. It should be noted that Unique::new is unsafe to call, becauseputting null inside of it is Undefined Behavior. Our stable Unique doesn’tneed new to be unsafe because it doesn’t make any interesting guarantees aboutits contents.