From f3d7196caec3f54e572c7389b1cef9fd9e62c1ed Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Wed, 12 Aug 2020 15:53:58 +0100 Subject: [PATCH] Be clearer about Some/None transmute. --- library/core/src/option.rs | 5 +++-- 1 file 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` but only from non-`None` -//! Option` to `T`. +//! from all valid values of `T` to `Option` but only from +//! `Option::Some(T)` to `T` (i.e. transmuting `None` to `` is undefined +//! behaviour). //! //! # Examples //!