about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurence Tratt <laurie@tratt.net>2020-08-12 15:53:58 +0100
committerLaurence Tratt <laurie@tratt.net>2020-08-12 15:53:58 +0100
commitf3d7196caec3f54e572c7389b1cef9fd9e62c1ed (patch)
tree04fe197a1cc2475e0fb7c88ed2f21c1f4d42ba0c
parent83f47aa11bd664ed8a15ef9833063833b7b3e71c (diff)
downloadrust-f3d7196caec3f54e572c7389b1cef9fd9e62c1ed.tar.gz
rust-f3d7196caec3f54e572c7389b1cef9fd9e62c1ed.zip
Be clearer about Some/None transmute.
-rw-r--r--library/core/src/option.rs5
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
 //!