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.

26 lines
483 B
Rust
Raw Normal View History

2020-04-07 15:01:41 -05:00
// aux-build:consts.rs
#![warn(indirect_structural_match)]
extern crate consts;
struct Defaulted;
impl consts::AssocConst for Defaulted {}
2020-04-07 15:01:41 -05:00
fn main() {
let _ = Defaulted;
2020-04-07 15:01:41 -05:00
match None {
consts::SOME => panic!(),
2020-04-07 15:01:41 -05:00
//~^ must be annotated with `#[derive(PartialEq, Eq)]`
_ => {}
}
match None {
<Defaulted as consts::AssocConst>::SOME => panic!(),
//~^ must be annotated with `#[derive(PartialEq, Eq)]`
_ => {}
}
2020-04-07 15:01:41 -05:00
}