]>
Commit | Line | Data |
---|---|---|
f035d41b | 1 | #![feature(const_raw_ptr_to_usize_cast, const_raw_ptr_deref)] |
7453a54e | 2 | |
a7813a04 | 3 | fn main() { |
b7449926 | 4 | let x: &'static bool = &(42 as *const i32 == 43 as *const i32); |
48663c56 XL |
5 | //~^ ERROR temporary value dropped while borrowed |
6 | let y: &'static usize = &(&1 as *const i32 as usize + 1); | |
7 | //~^ ERROR temporary value dropped while borrowed | |
8 | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); | |
9 | //~^ ERROR temporary value dropped while borrowed | |
10 | let a: &'static bool = &(main as fn() == main as fn()); | |
11 | //~^ ERROR temporary value dropped while borrowed | |
223e47cc | 12 | } |