Skip to content

Commit a497c67

Browse files
committed
Rollup merge of #27525 - Gankro:nomvar, r=aturon
I thought this was actually a huge error and I'd have to rewrite a bunch but it looks like everything else was correct. Closes #27457 r? @aturon
2 parents 0508329 + 67455e2 commit a497c67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/nomicon/subtyping.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ fn main() {
9393

9494
The signature of `overwrite` is clearly valid: it takes mutable references to
9595
two values of the same type, and overwrites one with the other. If `&mut T` was
96-
variant over T, then `&mut &'a str` would be a subtype of `&mut &'static str`,
97-
since `&'a str` is a subtype of `&'static str`. Therefore the lifetime of
96+
variant over T, then `&mut &'static str` would be a subtype of `&mut &'a str`,
97+
since `&'static str` is a subtype of `&'a str`. Therefore the lifetime of
9898
`forever_str` would successfully be "shrunk" down to the shorter lifetime of
9999
`string`, and `overwrite` would be called successfully. `string` would
100100
subsequently be dropped, and `forever_str` would point to freed memory when we

0 commit comments

Comments
 (0)