2018-08-08 14:28:26 +02:00
|
|
|
error[E0597]: `x` does not live long enough
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/static-lifetime-bound.rs:5:7
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2023-01-15 03:06:44 +00:00
|
|
|
LL | let x = 0;
|
|
|
|
| - binding `x` declared here
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | f(&x);
|
2019-04-22 08:40:08 +01:00
|
|
|
| --^^-
|
|
|
|
| | |
|
|
|
|
| | borrowed value does not live long enough
|
|
|
|
| argument requires that `x` is borrowed for `'static`
|
2018-08-08 14:28:26 +02:00
|
|
|
LL | }
|
2019-04-22 08:40:08 +01:00
|
|
|
| - `x` dropped here while still borrowed
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2023-02-22 09:41:48 +08:00
|
|
|
error: aborting due to previous error
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|