Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename
y
to _y
to get the correct compile error
Without this change, the error is: ``` Compiling playground v0.0.1 (/playground) warning: unused variable: `y` --> src/main.rs:13:9 | 13 | let y: &'a i32 = &_x; | ^ help: if this is intentional, prefix it with an underscore: `_y` | = note: `#[warn(unused_variables)]` on by default error[E0597]: `_x` does not live long enough --> src/main.rs:13:22 | 9 | fn failed_borrow<'a>() { | -- lifetime `'a` defined here 10 | let _x = 12; | -- binding `_x` declared here ... 13 | let y: &'a i32 = &_x; | ------- ^^^ borrowed value does not live long enough | | | type annotation requires that `_x` is borrowed for `'a` ... 17 | } | - `_x` dropped here while still borrowed For more information about this error, try `rustc --explain E0597`. warning: `playground` (bin "playground") generated 1 warning error: could not compile `playground` (bin "playground") due to previous error; 1 warning emitted ```
- Loading branch information