2018-01-12 19:54:52 +09:00
|
|
|
fn xyz() -> u8 { 42 }
|
|
|
|
|
|
|
|
|
|
const NUM: u8 = xyz();
|
2024-12-23 21:49:48 +00:00
|
|
|
//~^ ERROR cannot call non-const function
|
2018-01-12 19:54:52 +09:00
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
match 1 {
|
2024-11-20 02:37:56 +00:00
|
|
|
NUM => unimplemented!(), // ok, the `const` already emitted an error
|
2018-01-12 19:54:52 +09:00
|
|
|
_ => unimplemented!(),
|
|
|
|
|
}
|
|
|
|
|
}
|