]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc1445/phantom-data-is-structurally-matchable.rs
3 // This file checks that `PhantomData` is considered structurally matchable.
5 use std
::marker
::PhantomData
;
10 // A type which is not structurally matchable:
14 #[derive(PartialEq, Eq)]
17 // Check that SM is structural-match:
23 // Check that PhantomData<T> is structural-match even if T is not.
24 const CPD1
: PhantomData
<NotSM
> = PhantomData
;
29 // Check that PhantomData<T> is structural-match when T is.
30 const CPD2
: PhantomData
<SM
> = PhantomData
;
35 // Check that a type which has a PhantomData is structural-match.
36 #[derive(PartialEq, Eq, Default)]
38 alpha
: PhantomData
<NotSM
>,
39 beta
: PhantomData
<SM
>,
42 const CFOO
: Foo
= Foo
{
47 match Foo
::default() {
51 // Final count must be 4 now if all