Trait core::marker::StructuralPartialEq [−][src]
Required trait for constants used in pattern matches.
Any type that derives PartialEq
automatically implements this trait,
regardless of whether its type-parameters implement Eq
.
If a const
item contains some type that does not implement this trait,
then that type either (1.) does not implement PartialEq
(which means the
constant will not provide that comparison method, which code generation
assumes is available), or (2.) it implements its own version of
PartialEq
(which we assume does not conform to a structural-equality
comparison).
In either of the two scenarios above, we reject usage of such a constant in a pattern match.
See also the structural match RFC, and issue 63438 which motivated migrating from attribute-based design to this trait.
Implementors
impl StructuralPartialEq for core::cmp::Ordering
1.0.0[src]
impl StructuralPartialEq for FpCategory
1.0.0[src]
impl StructuralPartialEq for IntErrorKind
[src]
impl StructuralPartialEq for SearchStep
[src]
impl StructuralPartialEq for core::sync::atomic::Ordering
1.0.0[src]
impl StructuralPartialEq for AllocError
[src]
impl StructuralPartialEq for Layout
1.28.0[src]
impl StructuralPartialEq for LayoutError
1.50.0[src]
impl StructuralPartialEq for TypeId
1.0.0[src]
impl StructuralPartialEq for CpuidResult
1.27.0[src]
This is supported on x86 or x86-64 only.