Skip to content

Commit 79575a1

Browse files
committed
Mention "null pointer optimization" in option docs.
1 parent 9f75dbf commit 79575a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/option.rs

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

0 commit comments

Comments
 (0)