rust/tests/ui/consts/issue-43105.rs
2024-12-23 22:15:32 +00:00

11 lines
231 B
Rust

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!(),
}
}