2018-09-18 19:48:47 -05:00
|
|
|
error[E0597]: `x` does not live long enough
|
2019-10-19 15:01:36 -05:00
|
|
|
--> $DIR/issue-52534-2.rs:6:13
|
2018-09-18 19:48:47 -05:00
|
|
|
|
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let x = 32;
|
|
|
|
| - binding `x` declared here
|
2018-09-18 19:48:47 -05:00
|
|
|
LL | y = &x
|
2019-10-19 15:01:36 -05:00
|
|
|
| ^^ borrowed value does not live long enough
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-09-18 19:48:47 -05:00
|
|
|
LL | }
|
|
|
|
| - `x` dropped here while still borrowed
|
2022-06-08 13:07:59 -05:00
|
|
|
LL |
|
2018-09-18 19:48:47 -05:00
|
|
|
LL | println!("{}", y);
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|