rust/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs
Dylan MacKenzie bcc44b8e02 Test associated const default qualifs cross-crate
This also tests for the ICE in #71734
2020-05-02 14:46:22 -07:00

28 lines
609 B
Rust

// aux-build:consts.rs
#![warn(indirect_structural_match)]
extern crate consts;
struct Defaulted;
impl consts::AssocConst for Defaulted {}
fn main() {
let _ = Defaulted;
match None {
consts::SOME => panic!(),
//~^ must be annotated with `#[derive(PartialEq, Eq)]`
//~| must be annotated with `#[derive(PartialEq, Eq)]`
_ => {}
}
match None {
<Defaulted as consts::AssocConst>::SOME => panic!(),
//~^ must be annotated with `#[derive(PartialEq, Eq)]`
//~| must be annotated with `#[derive(PartialEq, Eq)]`
_ => {}
}
}