You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
```
0 commit comments