QuickNotes
The Unsafe Chronicles: Exhibit A: Aliasing Boxes
std::mem::transmute
: dont use unit absolutely necessary. you can do reaaaly unsound things with thisstd::mem::ManuallyDrop
: Prevents callingT
's destructor. Allows us to provide our own drop rulesstd::mem::MaybeUninit
: Wrapper that says that the content might not be valid yet. Usually the compiler has some rules that are always upheld and thus make optimizations for it. MaybeUninit signals the compiler to assume nothing about the type and thus prevent these optimizations.repr(transparent)
std::marker::PhantomData
: Used to carry around info at compile time. Is 0 sized. Also check the nomicon