Files
rust/tests/ui/consts/const_in_pattern/cross-crate-fail.rs

24 lines
439 B
Rust
Raw Normal View History

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