2018-01-12 19:54:52 +09:00
|
|
|
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]
|
2018-01-12 19:54:52 +09:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match 1 {
|
|
|
|
NUM => unimplemented!(),
|
2018-11-16 18:38:28 +01:00
|
|
|
//~^ ERROR could not evaluate constant pattern
|
2018-01-12 19:54:52 +09:00
|
|
|
_ => unimplemented!(),
|
|
|
|
}
|
|
|
|
}
|