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