summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
blob: df20ff446cda24bf82b02eb1510df1e07693c812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
//~^ dereferencing raw mutable pointers in constant functions

const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
//~^ dereferencing raw mutable pointers in constant functions

const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
//~^ dereferencing raw mutable pointers in constant functions

const unsafe fn bad_const_unsafe_deref_raw_underscore(x: *mut usize) { let _ = *x; }
//~^ dereferencing raw mutable pointers in constant functions

fn main() {}