diff options
| author | Laurence Tratt <laurie@tratt.net> | 2020-08-12 15:53:58 +0100 |
|---|---|---|
| committer | Laurence Tratt <laurie@tratt.net> | 2020-08-12 15:53:58 +0100 |
| commit | f3d7196caec3f54e572c7389b1cef9fd9e62c1ed (patch) | |
| tree | 04fe197a1cc2475e0fb7c88ed2f21c1f4d42ba0c | |
| parent | 83f47aa11bd664ed8a15ef9833063833b7b3e71c (diff) | |
| download | rust-f3d7196caec3f54e572c7389b1cef9fd9e62c1ed.tar.gz rust-f3d7196caec3f54e572c7389b1cef9fd9e62c1ed.zip | |
Be clearer about Some/None transmute.
| -rw-r--r-- | library/core/src/option.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs index db7583b0419..a8337c171a5 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -84,8 +84,9 @@ //! * `#[repr(transparent)]` struct around one of the types in this list. //! //! For the above cases, it is guaranteed that one can [`mem::transmute`] -//! from all valid values of `T` to `Option<T>` but only from non-`None` -//! Option<T>` to `T`. +//! from all valid values of `T` to `Option<T>` but only from +//! `Option::Some(T)` to `T` (i.e. transmuting `None` to `<T>` is undefined +//! behaviour). //! //! # Examples //! |
