rust/src/test/ui/consts/const-int-sign.stderr

25 lines
910 B
Plaintext
Raw Normal View History

2018-09-01 13:05:55 +00:00
error[E0597]: borrowed value does not live long enough
2018-12-25 15:56:47 +00:00
--> $DIR/const-int-sign.rs:2:29
2018-09-01 13:05:55 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let x: &'static bool = &(5_i32.is_negative());
2018-09-01 13:05:55 +00:00
| ^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
2019-03-09 12:03:44 +00:00
LL | let y: &'static bool = &(5_i32.is_positive());
2018-09-01 13:05:55 +00:00
LL | }
| - temporary value only lives until here
|
= note: borrowed value must be valid for the static lifetime...
error[E0597]: borrowed value does not live long enough
2018-12-25 15:56:47 +00:00
--> $DIR/const-int-sign.rs:3:29
2018-09-01 13:05:55 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let y: &'static bool = &(5_i32.is_positive());
2018-09-01 13:05:55 +00:00
| ^^^^^^^^^^^^^^^^^^^^^ 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`.