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

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

22 lines
374 B
Rust
Raw Normal View History

2020-04-07 20:01:41 +00:00
//@ run-pass
//@ aux-build:consts.rs
extern crate consts;
use consts::CustomEq;
2020-04-07 20:01:41 +00:00
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 Some(CustomEq) {
consts::NONE => panic!(),
2020-04-07 20:01:41 +00:00
_ => {}
}
match Some(CustomEq) {
<Defaulted as consts::AssocConst>::NONE => panic!(),
_ => {}
}
2020-04-07 20:01:41 +00:00
}