File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1118,6 +1118,11 @@ impl<T> fmt::Debug for Discriminant<T> {
11181118///
11191119/// [Reference]: ../../reference/items/enumerations.html#custom-discriminant-values-for-fieldless-enumerations
11201120///
1121+ /// The value of a [`Discriminant<T>`] is independent of any *lifetimes* in `T`. As such, reading
1122+ /// or writing a `Discriminant<Foo<'a>>` as a `Discriminant<Foo<'b>>` (whether via [`transmute`] or
1123+ /// otherwise) is always sound. Note that this is **not** true for other kinds of generic
1124+ /// parameters; `Discriminant<Foo<A>>` and `Discriminant<Foo<B>>` might be incompatible.
1125+ ///
11211126/// # Examples
11221127///
11231128/// This can be used to compare enums that carry data, while disregarding
You can’t perform that action at this time.
0 commit comments