blob: 0b1ab1c34ff2f3dc7b44277ef29d82cca41441f9 [file] [log] [blame]
const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe
//~^ dereferencing raw pointers in constant functions
const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
//~^ dereferencing raw pointers in constant functions
const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
//~^ dereferencing raw pointers in constant functions
fn main() {}
const unsafe fn no_union() {
union Foo { x: (), y: () }
Foo { x: () }.y
//~^ accessing union fields is unstable
}