]>
Commit | Line | Data |
---|---|---|
3dfed10e | 1 | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } |
e1599b0c XL |
2 | //~^ dereferencing raw pointers in constant functions |
3 | ||
4 | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x } | |
5 | //~^ dereferencing raw pointers in constant functions | |
6 | ||
7 | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x } | |
8 | //~^ dereferencing raw pointers in constant functions | |
9 | ||
10 | fn main() {} | |
11 | ||
12 | const unsafe fn no_union() { | |
13 | union Foo { x: (), y: () } | |
14 | Foo { x: () }.y | |
1b1a35ee | 15 | //~^ unions in const fn |
e1599b0c | 16 | } |