2020-04-07 15:01:41 -05:00
|
|
|
// run-pass
|
|
|
|
// aux-build:consts.rs
|
|
|
|
|
|
|
|
#![warn(indirect_structural_match)]
|
|
|
|
|
|
|
|
extern crate consts;
|
2020-04-28 16:30:44 -05:00
|
|
|
use consts::CustomEq;
|
2020-04-07 15:01:41 -05:00
|
|
|
|
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 Some(CustomEq) {
|
2020-04-28 16:30:44 -05:00
|
|
|
consts::NONE => panic!(),
|
2020-04-07 15:01:41 -05:00
|
|
|
_ => {}
|
|
|
|
}
|
2020-05-02 16:39:12 -05:00
|
|
|
|
|
|
|
match Some(CustomEq) {
|
|
|
|
<Defaulted as consts::AssocConst>::NONE => panic!(),
|
|
|
|
_ => {}
|
|
|
|
}
|
2020-04-07 15:01:41 -05:00
|
|
|
}
|