From 83f47aa11bd664ed8a15ef9833063833b7b3e71c Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Wed, 12 Aug 2020 15:47:37 +0100 Subject: [PATCH] Be clear about the reverse `transmute` guarantees. --- 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 c1837f79840d..db7583b04190 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -83,8 +83,9 @@ //! * [`ptr::NonNull`] //! * `#[repr(transparent)]` struct around one of the types in this list. //! -//! For the above cases, it is guaranteed that one can use [`mem::transmute`] -//! between `T` and `Option` and vice versa. +//! 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`. //! //! # Examples //!