summaryrefslogtreecommitdiffstats
path: root/tests/ui/inline-const/pat-unsafe-err.rs
blob: 6df281c6d945e2847952b7dc1372582ea0f9f709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// revisions: mir thir
// [mir]ignore-test This is currently broken
// [thir]compile-flags: -Z thir-unsafeck

#![allow(incomplete_features)]
#![feature(inline_const_pat)]

const unsafe fn require_unsafe() -> usize {
    1
}

fn main() {
    match () {
        const {
            require_unsafe();
            //~^ ERROR [E0133]
        } => (),
    }

    match 1 {
        const {
            require_unsafe()
            //~^ ERROR [E0133]
        }..=4 => (),
        _ => (),
    }
}