summaryrefslogtreecommitdiffstats
path: root/tests/ui/unsafe/unsafe-const-fn.rs
blob: 65e3acf3063726233ef35b681b7259833ae13ff1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// A quick test of 'unsafe const fn' functionality

// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck

const unsafe fn dummy(v: u32) -> u32 {
    !v
}

const VAL: u32 = dummy(0xFFFF);
//~^ ERROR E0133

fn main() {
    assert_eq!(VAL, 0xFFFF0000);
}