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