2018-01-12 19:54:52 +09:00
|
|
|
fn xyz() -> u8 { 42 }
|
|
|
|
|
|
|
|
const NUM: u8 = xyz();
|
2021-12-10 01:10:05 +08:00
|
|
|
//~^ ERROR cannot call non-const fn
|
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!(),
|
|
|
|
}
|
|
|
|
}
|