From 79575a1a8e55d767c63958f5970e6858b8e8e176 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Sat, 29 May 2021 09:54:31 -0700 Subject: [PATCH] Mention "null pointer optimization" in option docs. --- library/core/src/option.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index cfb73ed0395..4e7afca6a49 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -83,6 +83,8 @@ //! * [`ptr::NonNull`] //! * `#[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` and //! from `Some::(_)` to `T` (but transmuting `None::` to `T`