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