rust/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr

47 lines
1.7 KiB
Plaintext
Raw Normal View History

error[E0597]: borrowed value does not live long enough
2018-12-25 09:56:47 -06:00
--> $DIR/promoted_raw_ptr_ops.rs:4: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
2018-12-25 09:56:47 -06:00
--> $DIR/promoted_raw_ptr_ops.rs:6:30
|
2019-03-09 06:03:44 -06:00
LL | let y: &'static usize = &(&1 as *const i32 as usize + 1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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
2018-12-25 09:56:47 -06:00
--> $DIR/promoted_raw_ptr_ops.rs:7:28
|
2019-03-09 06:03:44 -06:00
LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
2019-03-09 06:03:44 -06:00
LL | let a: &'static bool = &(main as fn() == main as fn());
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 09:56:47 -06:00
--> $DIR/promoted_raw_ptr_ops.rs:8:29
|
2019-03-09 06:03:44 -06:00
LL | let a: &'static bool = &(main as fn() == main as fn());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 4 previous errors
For more information about this error, try `rustc --explain E0597`.