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][..] {
|
2024-02-08 13:08:19 -06:00
|
|
|
C => (), //~ERROR: the type must implement `PartialEq`
|
2020-03-16 23:01:05 -05:00
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
}
|