rust/tests/ui/consts/issue-43105.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
291 B
Rust
Raw Normal View History

fn xyz() -> u8 { 42 }
const NUM: u8 = xyz();
2021-12-09 17:10:05 +00:00
//~^ ERROR cannot call non-const fn
fn main() {
match 1 {
NUM => unimplemented!(),
2018-11-16 17:38:28 +00:00
//~^ ERROR could not evaluate constant pattern
2020-01-08 17:02:10 +00:00
//~| ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}