Skip to content

Commit

Permalink
Mention "null pointer optimization" in option docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed May 29, 2021
1 parent 9f75dbf commit 79575a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 79575a1

Please sign in to comment.