rust/src/test/ui/nll/user-annotations/cast_static_lifetime.stderr

15 lines
550 B
Plaintext
Raw Normal View History

error[E0597]: `x` does not live long enough
2018-12-25 09:56:47 -06:00
--> $DIR/cast_static_lifetime.rs:6:19
|
2018-11-27 03:56:36 -06:00
LL | let y: &u32 = (&x) as &'static u32; //~ ERROR `x` does not live long enough
| ^^^^----------------
| |
| borrowed value does not live long enough
| type annotation requires that `x` is borrowed for `'static`
LL | }
| - `x` dropped here while still borrowed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`.