From 613145f6c4e46a9528f70197ad0869c2511b134d Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sat, 25 May 2024 15:46:55 -0600 Subject: [PATCH] Resolve https://github.com/rust-lang/rust/pull/124870#issuecomment-2128824959 --- core/src/option.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/option.rs b/core/src/option.rs index 1e3ed0f7c49f1..c9b3c62dc4167 100644 --- a/core/src/option.rs +++ b/core/src/option.rs @@ -137,10 +137,13 @@ //! //! [^extern_fn]: this remains true for any argument/return types and any other ABI: `extern "abi" fn` (_e.g._, `extern "system" fn`) //! +//! Under some conditions the above types `T` are also null pointer optimized when wrapped in a [`Result`][result_repr]. +//! //! [`Box`]: ../../std/boxed/struct.Box.html //! [`num::NonZero*`]: crate::num //! [`ptr::NonNull`]: crate::ptr::NonNull //! [function call ABI]: ../primitive.fn.html#abi-compatibility +//! [result_repr]: crate::result::Result#Representation //! //! This is called the "null pointer optimization" or NPO. //!