blob: 231af76fc932d024adc62b3b3e2cec5b084f7c54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
fn xyz() -> u8 { 42 }
const NUM: u8 = xyz();
//~^ ERROR calls in constants are limited to constant functions, tuple structs and tuple variants
//~| ERROR any use of this value will cause an error [const_err]
fn main() {
match 1 {
NUM => unimplemented!(),
//~^ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}
|