diff options
| author | bors <bors@rust-lang.org> | 2023-12-04 19:46:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-04 19:46:46 +0000 |
| commit | a28077b28a02b92985b3a3faecf92813155f1ea1 (patch) | |
| tree | 2b3b10b83a2f87104f139d2e634ac83a9cc38066 /library/core/src | |
| parent | 79e9716c980570bfd1f666e3b16ac583f0168962 (diff) | |
| parent | de148ecd5c7b1675460843a8a35a370e4360a257 (diff) | |
| download | rust-1.74.1.tar.gz rust-1.74.1.zip | |
Auto merge of #118607 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.74.1
[stable] 1.74.1 release This includes backports of: * Dispose llvm::TargetMachines prior to llvm::Context being disposed #118464 * clarify fn discriminant guarantees: only free lifetimes may get erased #118006 * Move subtyper below reveal_all and change reveal_all #116415 * Make subtyping explicit in MIR #115025 (needed for above) As well as infrastructure fix: * Don't ask for a specific branch in cargotest #118597 r? `@Mark-Simulacrum`
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/mem/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 52da1f843da..e478b217fd6 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1126,10 +1126,12 @@ impl<T> fmt::Debug for Discriminant<T> { /// /// [Reference]: ../../reference/items/enumerations.html#custom-discriminant-values-for-fieldless-enumerations /// -/// The value of a [`Discriminant<T>`] is independent of any *lifetimes* in `T`. As such, reading -/// or writing a `Discriminant<Foo<'a>>` as a `Discriminant<Foo<'b>>` (whether via [`transmute`] or -/// otherwise) is always sound. Note that this is **not** true for other kinds of generic -/// parameters; `Discriminant<Foo<A>>` and `Discriminant<Foo<B>>` might be incompatible. +/// The value of a [`Discriminant<T>`] is independent of any *free lifetimes* in `T`. As such, +/// reading or writing a `Discriminant<Foo<'a>>` as a `Discriminant<Foo<'b>>` (whether via +/// [`transmute`] or otherwise) is always sound. Note that this is **not** true for other kinds +/// of generic parameters and for higher-ranked lifetimes; `Discriminant<Foo<A>>` and +/// `Discriminant<Foo<B>>` as well as `Discriminant<Bar<dyn for<'a> Trait<'a>>>` and +/// `Discriminant<Bar<dyn Trait<'static>>>` may be incompatible. /// /// # Examples /// |
