rust/tests/ui/consts/const_in_pattern/cross-crate-fail.rs

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

22 lines
469 B
Rust
Raw Normal View History

2020-04-07 20:01:41 +00:00
//@ aux-build:consts.rs
extern crate consts;
struct Defaulted;
impl consts::AssocConst for Defaulted {}
2020-04-07 20:01:41 +00:00
fn main() {
let _ = Defaulted;
2020-04-07 20:01:41 +00:00
match None {
consts::SOME => panic!(),
//~^ ERROR constant of non-structural type `CustomEq` in a pattern
2020-04-07 20:01:41 +00:00
_ => {}
}
match None {
<Defaulted as consts::AssocConst>::SOME => panic!(),
//~^ ERROR constant of non-structural type `CustomEq` in a pattern
_ => {}
}
2020-04-07 20:01:41 +00:00
}