about summary refs log tree commit diff
path: root/tests/ui/consts/issue-43105.rs
blob: 738b73416e0d0b8e1cced608ef17a63dc83de0cb (plain)
1
2
3
4
5
6
7
8
9
10
11
fn xyz() -> u8 { 42 }

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

fn main() {
    match 1 {
        NUM => unimplemented!(), // ok, the `const` already emitted an error
        _ => unimplemented!(),
    }
}