Mention "null pointer optimization" in option docs.

This commit is contained in:
Jacob Hoffman-Andrews 2021-05-29 09:54:31 -07:00
parent 9f75dbfa69
commit 79575a1a8e

View File

@ -83,6 +83,8 @@
//! * [`ptr::NonNull<U>`]
//! * `#[repr(transparent)]` struct around one of the types in this list.
//!
//! This is called the "null pointer optimization" or NPO.
//!
//! It is further guaranteed that, for the cases above, one can
//! [`mem::transmute`] from all valid values of `T` to `Option<T>` and
//! from `Some::<T>(_)` to `T` (but transmuting `None::<T>` to `T`