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.

24 lines
439 B
Rust
Raw Permalink Normal View History

2020-04-07 15:01:41 -05:00
//@ aux-build:consts.rs
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!(),
2023-09-26 02:39:41 -05:00
//~^ must be annotated with `#[derive(PartialEq)]`
2020-04-07 15:01:41 -05:00
_ => {}
}
match None {
<Defaulted as consts::AssocConst>::SOME => panic!(),
2023-09-26 02:39:41 -05:00
//~^ must be annotated with `#[derive(PartialEq)]`
_ => {}
}
2020-04-07 15:01:41 -05:00
}