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

22 lines
469 B
Rust
Raw Normal View History

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