Skip to content

Commit a658124

Browse files
authored
Merge pull request #1769 from aviad-dev/patch-2
rename `y` to `_y` to get the correct compile error
2 parents 8957a71 + 3dffa1e commit a658124

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scope/lifetime/explicit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ fn failed_borrow<'a>() {
4040
let _x = 12;
4141
4242
// ERROR: `_x` does not live long enough
43-
let y: &'a i32 = &_x;
43+
let _y: &'a i32 = &_x;
4444
// Attempting to use the lifetime `'a` as an explicit type annotation
4545
// inside the function will fail because the lifetime of `&_x` is shorter
46-
// than that of `y`. A short lifetime cannot be coerced into a longer one.
46+
// than that of `_y`. A short lifetime cannot be coerced into a longer one.
4747
}
4848
4949
fn main() {

0 commit comments

Comments
 (0)