1 error[E0716]: temporary value dropped while borrowed
2 --> $DIR/promoted_raw_ptr_ops.rs:2:29
4 LL | let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
5 | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
7 | type annotation requires that borrow lasts for `'static`
10 | - temporary value is freed at the end of this statement
12 error[E0716]: temporary value dropped while borrowed
13 --> $DIR/promoted_raw_ptr_ops.rs:4:30
15 LL | let y: &'static usize = &(&1 as *const i32 as usize + 1);
16 | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
18 | type annotation requires that borrow lasts for `'static`
21 | - temporary value is freed at the end of this statement
23 error[E0716]: temporary value dropped while borrowed
24 --> $DIR/promoted_raw_ptr_ops.rs:6:28
26 LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) });
27 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
29 | type annotation requires that borrow lasts for `'static`
32 | - temporary value is freed at the end of this statement
34 error[E0716]: temporary value dropped while borrowed
35 --> $DIR/promoted_raw_ptr_ops.rs:8:29
37 LL | let a: &'static bool = &(main as fn() == main as fn());
38 | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
40 | type annotation requires that borrow lasts for `'static`
43 | - temporary value is freed at the end of this statement
45 error: aborting due to 4 previous errors
47 For more information about this error, try `rustc --explain E0716`.