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

14 lines
363 B
Rust
Raw Normal View History

fn xyz() -> u8 { 42 }
const NUM: u8 = xyz();
2018-04-17 18:59:27 +03:00
//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants
2018-11-16 18:38:28 +01:00
//~| ERROR any use of this value will cause an error [const_err]
fn main() {
match 1 {
NUM => unimplemented!(),
2018-11-16 18:38:28 +01:00
//~^ ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}