rust/src/test/ui/consts/promote_const_let.stderr

28 lines
813 B
Plaintext
Raw Normal View History

error[E0597]: `y` does not live long enough
--> $DIR/promote_const_let.rs:4:10
|
2019-03-09 06:03:44 -06:00
LL | &y
| ^ borrowed value does not live long enough
LL | };
| - borrowed value only lives until here
|
= note: borrowed value must be valid for the static lifetime...
error[E0597]: borrowed value does not live long enough
--> $DIR/promote_const_let.rs:6:28
|
2019-03-09 06:03:44 -06:00
LL | let x: &'static u32 = &{
| ____________________________^
LL | | let y = 42;
LL | | y
LL | | };
| |_____^ temporary value does not live long enough
LL | }
| - temporary value only lives until here
|
= note: borrowed value must be valid for the static lifetime...
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`.