mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
14 lines
291 B
Rust
14 lines
291 B
Rust
fn xyz() -> u8 { 42 }
|
|
|
|
const NUM: u8 = xyz();
|
|
//~^ ERROR cannot call non-const fn
|
|
|
|
fn main() {
|
|
match 1 {
|
|
NUM => unimplemented!(),
|
|
//~^ ERROR could not evaluate constant pattern
|
|
//~| ERROR could not evaluate constant pattern
|
|
_ => unimplemented!(),
|
|
}
|
|
}
|