diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index b1bbcaeab8def..cef319cd10d3a 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -929,8 +929,9 @@ pub unsafe fn transmute_copy(src: &T) -> U { /// See the [`discriminant`] function in this module for more information. /// /// [`discriminant`]: fn.discriminant.html +// We use `PhantomData T>` because we want `Discriminant` to be invariant. #[stable(feature = "discriminant_value", since = "1.21.0")] -pub struct Discriminant(u64, PhantomData T>); +pub struct Discriminant(u64, PhantomData T>); // N.B. These trait implementations cannot be derived because we don't want any bounds on T.