2020-03-16 23:01:05 -05:00
|
|
|
#![deny(indirect_structural_match)]
|
|
|
|
|
2020-09-20 10:22:33 -05:00
|
|
|
// check-pass
|
|
|
|
|
2020-03-16 23:01:05 -05:00
|
|
|
#[derive(PartialEq, Eq)]
|
|
|
|
enum O<T> {
|
|
|
|
Some(*const T), // Can also use PhantomData<T>
|
|
|
|
None,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct B;
|
|
|
|
|
|
|
|
const C: &[O<B>] = &[O::None];
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = O::None;
|
|
|
|
match &[x][..] {
|
|
|
|
C => (),
|
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
}
|