diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index a67df7ed557a1..aa53aa29bdbf3 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1118,6 +1118,11 @@ impl fmt::Debug for Discriminant { /// /// [Reference]: ../../reference/items/enumerations.html#custom-discriminant-values-for-fieldless-enumerations /// +/// The value of a [`Discriminant`] is independent of any *lifetimes* in `T`. As such, reading +/// or writing a `Discriminant>` as a `Discriminant>` (whether via [`transmute`] or +/// otherwise) is always sound. Note that this is **not** true for other kinds of generic +/// parameters; `Discriminant>` and `Discriminant>` might be incompatible. +/// /// # Examples /// /// This can be used to compare enums that carry data, while disregarding