rust/src/test/ui/consts/issue-43105.rs

14 lines
353 B
Rust
Raw Normal View History

fn xyz() -> u8 { 42 }
const NUM: u8 = xyz();
2018-04-17 15:59:27 +00:00
//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants
fn main() {
match 1 {
NUM => unimplemented!(),
2018-11-16 17:38:28 +00:00
//~^ ERROR could not evaluate constant pattern
2020-01-08 17:02:10 +00:00
//~| ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}