mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-20 12:35:11 +00:00
22 lines
292 B
Rust
22 lines
292 B
Rust
#![deny(indirect_structural_match)]
|
|
|
|
// check-pass
|
|
|
|
#[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 => (),
|
|
_ => (),
|
|
}
|
|
}
|