Trait core::marker::StructuralPartialEq[][src]

pub trait StructuralPartialEq { }
🔬 This is a nightly-only experimental API. (structural_match #31434)
Expand description

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::Ordering1.0.0[src]

impl StructuralPartialEq for FpCategory1.0.0[src]

impl StructuralPartialEq for IntErrorKind[src]

impl StructuralPartialEq for SearchStep[src]

impl StructuralPartialEq for core::sync::atomic::Ordering1.0.0[src]

impl StructuralPartialEq for AllocError[src]

impl StructuralPartialEq for Layout1.28.0[src]

impl StructuralPartialEq for LayoutError1.50.0[src]

impl StructuralPartialEq for TypeId1.0.0[src]

impl StructuralPartialEq for CpuidResult1.27.0[src]

This is supported on x86 or x86-64 only.

impl StructuralPartialEq for CharTryFromError1.34.0[src]

impl StructuralPartialEq for DecodeUtf16Error1.9.0[src]

impl StructuralPartialEq for ParseCharError1.20.0[src]

impl StructuralPartialEq for Error1.0.0[src]

impl StructuralPartialEq for NonZeroI81.34.0[src]

impl StructuralPartialEq for NonZeroI161.34.0[src]

impl StructuralPartialEq for NonZeroI321.34.0[src]

impl StructuralPartialEq for NonZeroI641.34.0[src]

impl StructuralPartialEq for NonZeroI1281.34.0[src]

impl StructuralPartialEq for NonZeroIsize1.34.0[src]

impl StructuralPartialEq for NonZeroU81.28.0[src]

impl StructuralPartialEq for NonZeroU161.28.0[src]

impl StructuralPartialEq for NonZeroU321.28.0[src]

impl StructuralPartialEq for NonZeroU641.28.0[src]

impl StructuralPartialEq for NonZeroU1281.28.0[src]

impl StructuralPartialEq for NonZeroUsize1.28.0[src]

impl StructuralPartialEq for ParseFloatError1.0.0[src]

impl StructuralPartialEq for ParseIntError1.0.0[src]

impl StructuralPartialEq for TryFromIntError1.34.0[src]

impl StructuralPartialEq for RangeFull1.0.0[src]

impl StructuralPartialEq for NoneError[src]

impl StructuralPartialEq for ParseBoolError1.0.0[src]

impl StructuralPartialEq for Utf8Error1.0.0[src]

impl StructuralPartialEq for RawWaker1.36.0[src]

impl StructuralPartialEq for RawWakerVTable1.36.0[src]

impl StructuralPartialEq for Duration1.3.0[src]

impl StructuralPartialEq for PhantomPinned1.33.0[src]

impl<'a> StructuralPartialEq for Location<'a>1.10.0[src]

impl<'a> StructuralPartialEq for Utf8LossyChunk<'a>[src]

impl<B, C> StructuralPartialEq for ControlFlow<B, C>[src]

impl<Idx> StructuralPartialEq for Range<Idx>1.0.0[src]

impl<Idx> StructuralPartialEq for RangeFrom<Idx>1.0.0[src]

impl<Idx> StructuralPartialEq for RangeInclusive<Idx>1.26.0[src]

impl<Idx> StructuralPartialEq for RangeTo<Idx>1.0.0[src]

impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>1.26.0[src]

impl<T> StructuralPartialEq for Bound<T>1.17.0[src]

impl<T> StructuralPartialEq for Option<T>1.0.0[src]

impl<T> StructuralPartialEq for Poll<T>1.36.0[src]

impl<T> StructuralPartialEq for Reverse<T>1.19.0[src]

impl<T> StructuralPartialEq for Wrapping<T>1.0.0[src]

impl<T, E> StructuralPartialEq for Result<T, E>1.0.0[src]

impl<T: ?Sized> StructuralPartialEq for ManuallyDrop<T>1.20.0[src]

impl<T: ?Sized> StructuralPartialEq for PhantomData<T>[src]

impl<Y, R> StructuralPartialEq for GeneratorState<Y, R>[src]