Skip to content

Commit f3d7196

Browse files
committed
Be clearer about Some/None transmute.
1 parent 83f47aa commit f3d7196

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/core/src/option.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@
8484
//! * `#[repr(transparent)]` struct around one of the types in this list.
8585
//!
8686
//! For the above cases, it is guaranteed that one can [`mem::transmute`]
87-
//! from all valid values of `T` to `Option<T>` but only from non-`None`
88-
//! Option<T>` to `T`.
87+
//! from all valid values of `T` to `Option<T>` but only from
88+
//! `Option::Some(T)` to `T` (i.e. transmuting `None` to `<T>` is undefined
89+
//! behaviour).
8990
//!
9091
//! # Examples
9192
//!

0 commit comments

Comments
 (0)