mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00
12 lines
231 B
Rust
12 lines
231 B
Rust
fn xyz() -> u8 { 42 }
|
|
|
|
const NUM: u8 = xyz();
|
|
//~^ ERROR cannot call non-const function
|
|
|
|
fn main() {
|
|
match 1 {
|
|
NUM => unimplemented!(), // ok, the `const` already emitted an error
|
|
_ => unimplemented!(),
|
|
}
|
|
}
|