summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/issue-43105.rs
blob: cac12b90970fe78b3f1ad19a1cb46c34f061ab00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn xyz() -> u8 { 42 }

const NUM: u8 = xyz();
//~^ ERROR cannot call non-const fn

fn main() {
    match 1 {
        NUM => unimplemented!(),
        //~^ ERROR could not evaluate constant pattern
        //~| ERROR could not evaluate constant pattern
        _ => unimplemented!(),
    }
}