We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
transmute
1 parent 73ada2d commit f5118a5Copy full SHA for f5118a5
library/core/src/option.rs
@@ -72,16 +72,19 @@
72
//!
73
//! # Representation
74
75
-//! Rust guarantees to optimise the following inner types such that an [`Option`] which contains
76
-//! them has the same size as a pointer:
+//! Rust guarantees to optimize the following types `<T>` such that an
+//! [`Option<T>`] has the same size as `T`:
77
78
+//! * [`Box<T>`]
79
//! * `&T`
80
//! * `&mut T`
81
//! * `extern "C" fn`
82
//! * [`num::NonZero*`]
83
//! * [`ptr::NonNull<T>`]
84
//! * `#[repr(transparent)]` struct around one of the types in this list.
-//! * [`Box<T>`]
85
+//!
86
+//! For the above cases, it is guaranteed that one can use [`mem::transmute`]
87
+//! between `T` and `Option<T>` and vice versa.
88
89
//! # Examples
90
0 commit comments