PhantomData is not structurally matchable (#[structural_match]) #55028
Labels
A-typesystem
Area: The type system
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Given:
results in:
Is this intentional due to some soundness issue with having it otherwise? (I cannot think of any...)
We could fix this by attaching
#[structural_match]
toPhantomData<T>
manually.While having
PhantomData<T>
be structurally matchable is quite boring and useless on its lonesome it prevents other types that contain it from being structurally matchable. (not likely to occur very often, but when it occur it seems like it would be annoying...)r? @nikomatsakis
cc @rust-lang/lang
The text was updated successfully, but these errors were encountered: