Skip to content

Commit 6a3a055

Browse files
authored
Update error_codes.rs
1 parent ffc1c5a commit 6a3a055

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc/error_codes.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,15 +1912,17 @@ fn bar<'short, 'long>(c: Foo<'short>, l: &'long isize) {
19121912
```
19131913
19141914
In this example, we tried to set a value with an incompatible lifetime to
1915-
another one (`'long` != `'short`). We can solve this issue in two different
1916-
ways: either we make `'short` lives longer than `'long`:
1915+
another one (`'long` is unrelated to `'short`). We can solve this issue in two different
1916+
ways:
1917+
1918+
Either we make `'short` live at least as long as `'long`:
19171919
19181920
```
19191921
struct Foo<'a> {
19201922
x: &'a isize,
19211923
}
19221924
1923-
// we set 'short to outlive 'long
1925+
// we set 'short to live at least as long as 'long
19241926
fn bar<'short: 'long, 'long>(c: Foo<'short>, l: &'long isize) {
19251927
let _: Foo<'long> = c; // ok!
19261928
}

0 commit comments

Comments
 (0)