2018-08-03 06:27:35 -05:00
|
|
|
error[E0597]: borrowed value does not live long enough
|
|
|
|
--> $DIR/promoted_raw_ptr_ops.rs:14:29
|
|
|
|
|
|
|
|
|
LL | let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0597]: borrowed value does not live long enough
|
|
|
|
--> $DIR/promoted_raw_ptr_ops.rs:16:30
|
|
|
|
|
|
|
|
|
LL | let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
|
2018-09-30 13:25:19 -05:00
|
|
|
...
|
2018-08-03 06:27:35 -05: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
|
|
|
|
--> $DIR/promoted_raw_ptr_ops.rs:17:28
|
|
|
|
|
|
|
|
|
LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
|
2018-09-30 13:25:19 -05:00
|
|
|
LL | let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough
|
|
|
|
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
|
|
|
|
--> $DIR/promoted_raw_ptr_ops.rs:18:29
|
|
|
|
|
|
|
|
|
LL | let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
|
2018-08-03 06:27:35 -05:00
|
|
|
LL | }
|
|
|
|
| - temporary value only lives until here
|
|
|
|
|
|
|
|
|
= note: borrowed value must be valid for the static lifetime...
|
|
|
|
|
2018-09-30 13:25:19 -05:00
|
|
|
error: aborting due to 4 previous errors
|
2018-08-03 06:27:35 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|