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 PartialEq.

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 an attribute-based design to this trait.

Implementors§

source§

impl StructuralPartialEq for AsciiChar

1.65.0 · source§

impl StructuralPartialEq for BacktraceStatus

1.0.0 · source§

impl StructuralPartialEq for std::cmp::Ordering

source§

impl StructuralPartialEq for TryReserveErrorKind

1.0.0 · source§

impl StructuralPartialEq for VarError

1.28.0 · source§

impl StructuralPartialEq for std::fmt::Alignment

1.0.0 · source§

impl StructuralPartialEq for ErrorKind

1.0.0 · source§

impl StructuralPartialEq for SeekFrom

1.7.0 · source§

impl StructuralPartialEq for IpAddr

source§

impl StructuralPartialEq for Ipv6MulticastScope

1.0.0 · source§

impl StructuralPartialEq for Shutdown

1.0.0 · source§

impl StructuralPartialEq for SocketAddr

1.0.0 · source§

impl StructuralPartialEq for FpCategory

1.55.0 · source§

impl StructuralPartialEq for IntErrorKind

source§

impl StructuralPartialEq for BacktraceStyle

source§

impl StructuralPartialEq for SearchStep

1.0.0 · source§

impl StructuralPartialEq for std::sync::atomic::Ordering

1.12.0 · source§

impl StructuralPartialEq for RecvTimeoutError

1.0.0 · source§

impl StructuralPartialEq for TryRecvError

source§

impl StructuralPartialEq for DwarfFileType

source§

impl StructuralPartialEq for Format

source§

impl StructuralPartialEq for SectionId

source§

impl StructuralPartialEq for Vendor

source§

impl StructuralPartialEq for RunTimeEndian

source§

impl StructuralPartialEq for AbbreviationsCacheStrategy

source§

impl StructuralPartialEq for Pointer

source§

impl StructuralPartialEq for gimli::read::Error

source§

impl StructuralPartialEq for ColumnType

source§

impl StructuralPartialEq for Value

source§

impl StructuralPartialEq for ValueType

source§

impl StructuralPartialEq for bool

source§

impl StructuralPartialEq for char

source§

impl StructuralPartialEq for i8

source§

impl StructuralPartialEq for i16

source§

impl StructuralPartialEq for i32

source§

impl StructuralPartialEq for i64

source§

impl StructuralPartialEq for i128

source§

impl StructuralPartialEq for isize

source§

impl StructuralPartialEq for str

source§

impl StructuralPartialEq for u8

source§

impl StructuralPartialEq for u16

source§

impl StructuralPartialEq for u32

source§

impl StructuralPartialEq for u64

source§

impl StructuralPartialEq for u128

source§

impl StructuralPartialEq for ()

source§

impl StructuralPartialEq for usize

source§

impl StructuralPartialEq for AllocError

1.28.0 · source§

impl StructuralPartialEq for Layout

1.50.0 · source§

impl StructuralPartialEq for LayoutError

1.34.0 · source§

impl StructuralPartialEq for CharTryFromError

1.9.0 · source§

impl StructuralPartialEq for DecodeUtf16Error

1.20.0 · source§

impl StructuralPartialEq for ParseCharError

1.59.0 · source§

impl StructuralPartialEq for TryFromCharError

source§

impl StructuralPartialEq for UnorderedKeyError

1.57.0 · source§

impl StructuralPartialEq for TryReserveError

1.69.0 · source§

impl StructuralPartialEq for FromBytesUntilNulError

1.64.0 · source§

impl StructuralPartialEq for FromBytesWithNulError

1.64.0 · source§

impl StructuralPartialEq for FromVecWithNulError

1.64.0 · source§

impl StructuralPartialEq for IntoStringError

1.64.0 · source§

impl StructuralPartialEq for NulError

1.64.0 · source§

impl StructuralPartialEq for CString

1.0.0 · source§

impl StructuralPartialEq for std::fmt::Error

1.1.0 · source§

impl StructuralPartialEq for FileType

1.0.0 · source§

impl StructuralPartialEq for Permissions

source§

impl StructuralPartialEq for Assume

1.0.0 · source§

impl StructuralPartialEq for AddrParseError

1.0.0 · source§

impl StructuralPartialEq for Ipv4Addr

1.0.0 · source§

impl StructuralPartialEq for Ipv6Addr

1.0.0 · source§

impl StructuralPartialEq for SocketAddrV4

1.0.0 · source§

impl StructuralPartialEq for SocketAddrV6

1.0.0 · source§

impl StructuralPartialEq for ParseFloatError

1.0.0 · source§

impl StructuralPartialEq for ParseIntError

1.34.0 · source§

impl StructuralPartialEq for TryFromIntError

1.0.0 · source§

impl StructuralPartialEq for RangeFull

source§

impl StructuralPartialEq for UCred

Available on Unix only.
1.63.0 · source§

impl StructuralPartialEq for InvalidHandleError

Available on Windows only.
1.63.0 · source§

impl StructuralPartialEq for NullHandleError

Available on Windows only.
1.7.0 · source§

impl StructuralPartialEq for StripPrefixError

1.0.0 · source§

impl StructuralPartialEq for ExitStatus

source§

impl StructuralPartialEq for ExitStatusError

1.0.0 · source§

impl StructuralPartialEq for Output

source§

impl StructuralPartialEq for std::ptr::Alignment

1.0.0 · source§

impl StructuralPartialEq for ParseBoolError

1.0.0 · source§

impl StructuralPartialEq for Utf8Error

1.0.0 · source§

impl StructuralPartialEq for FromUtf8Error

1.0.0 · source§

impl StructuralPartialEq for String

1.0.0 · source§

impl StructuralPartialEq for RecvError

1.5.0 · source§

impl StructuralPartialEq for WaitTimeoutResult

1.36.0 · source§

impl StructuralPartialEq for RawWaker

1.36.0 · source§

impl StructuralPartialEq for RawWakerVTable

1.26.0 · source§

impl StructuralPartialEq for AccessError

1.19.0 · source§

impl StructuralPartialEq for ThreadId

1.3.0 · source§

impl StructuralPartialEq for Duration

1.8.0 · source§

impl StructuralPartialEq for Instant

1.8.0 · source§

impl StructuralPartialEq for SystemTime

1.66.0 · source§

impl StructuralPartialEq for TryFromFloatSecsError

source§

impl StructuralPartialEq for DebugTypeSignature

source§

impl StructuralPartialEq for DwoId

source§

impl StructuralPartialEq for Encoding

source§

impl StructuralPartialEq for LineEncoding

source§

impl StructuralPartialEq for Register

source§

impl StructuralPartialEq for DwAccess

source§

impl StructuralPartialEq for DwAddr

source§

impl StructuralPartialEq for DwAt

source§

impl StructuralPartialEq for DwAte

source§

impl StructuralPartialEq for DwCc

source§

impl StructuralPartialEq for DwCfa

source§

impl StructuralPartialEq for DwChildren

source§

impl StructuralPartialEq for DwDefaulted

source§

impl StructuralPartialEq for DwDs

source§

impl StructuralPartialEq for DwDsc

source§

impl StructuralPartialEq for DwEhPe

source§

impl StructuralPartialEq for DwEnd

source§

impl StructuralPartialEq for DwForm

source§

impl StructuralPartialEq for DwId

source§

impl StructuralPartialEq for DwIdx

source§

impl StructuralPartialEq for DwInl

source§

impl StructuralPartialEq for DwLang

source§

impl StructuralPartialEq for DwLle

source§

impl StructuralPartialEq for DwLnct

source§

impl StructuralPartialEq for DwLne

source§

impl StructuralPartialEq for DwLns

source§

impl StructuralPartialEq for DwMacro

source§

impl StructuralPartialEq for DwOp

source§

impl StructuralPartialEq for DwOrd

source§

impl StructuralPartialEq for DwRle

source§

impl StructuralPartialEq for DwSect

source§

impl StructuralPartialEq for DwSectV2

source§

impl StructuralPartialEq for DwTag

source§

impl StructuralPartialEq for DwUt

source§

impl StructuralPartialEq for DwVirtuality

source§

impl StructuralPartialEq for DwVis

source§

impl StructuralPartialEq for BigEndian

source§

impl StructuralPartialEq for LittleEndian

source§

impl StructuralPartialEq for Abbreviation

source§

impl StructuralPartialEq for AttributeSpecification

source§

impl StructuralPartialEq for ArangeEntry

source§

impl StructuralPartialEq for Augmentation

source§

impl StructuralPartialEq for BaseAddresses

source§

impl StructuralPartialEq for SectionBaseAddresses

source§

impl StructuralPartialEq for UnitIndexSection

source§

impl StructuralPartialEq for FileEntryFormat

source§

impl StructuralPartialEq for LineRow

source§

impl StructuralPartialEq for ReaderOffsetId

source§

impl StructuralPartialEq for gimli::read::rnglists::Range

source§

impl StructuralPartialEq for StoreOnHeap

1.33.0 · source§

impl StructuralPartialEq for PhantomPinned

1.0.0 · source§

impl<'a> StructuralPartialEq for Component<'a>

1.0.0 · source§

impl<'a> StructuralPartialEq for Prefix<'a>

1.10.0 · source§

impl<'a> StructuralPartialEq for std::panic::Location<'a>

source§

impl<'a> StructuralPartialEq for Utf8Chunk<'a>

source§

impl<'bases, Section, R> StructuralPartialEq for CieOrFde<'bases, Section, R>
where R: Reader, Section: UnwindSection<R>,

source§

impl<'bases, Section, R> StructuralPartialEq for PartialFrameDescriptionEntry<'bases, Section, R>
where R: Reader, Section: UnwindSection<R>,

source§

impl<'input, Endian> StructuralPartialEq for EndianSlice<'input, Endian>
where Endian: Endianity,

1.55.0 · source§

impl<B, C> StructuralPartialEq for ControlFlow<B, C>

1.0.0 · source§

impl<Idx> StructuralPartialEq for std::ops::Range<Idx>

1.0.0 · source§

impl<Idx> StructuralPartialEq for RangeFrom<Idx>

1.26.0 · source§

impl<Idx> StructuralPartialEq for RangeInclusive<Idx>

1.0.0 · source§

impl<Idx> StructuralPartialEq for RangeTo<Idx>

1.26.0 · source§

impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>

source§

impl<Offset> StructuralPartialEq for UnitType<Offset>
where Offset: ReaderOffset,

source§

impl<R> StructuralPartialEq for CallFrameInstruction<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for CfaRule<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for RegisterRule<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for EvaluationResult<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for DebugFrame<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for EhFrame<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for EhFrameHdr<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for LocationListEntry<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for Expression<R>
where R: Reader,

source§

impl<R> StructuralPartialEq for Attribute<R>
where R: Reader,

source§

impl<R, A> StructuralPartialEq for UnwindContext<R, A>
where R: Reader, A: UnwindContextStorage<R>,

source§

impl<R, Offset> StructuralPartialEq for LineInstruction<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for gimli::read::op::Location<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for Operation<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for AttributeValue<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for ArangeHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for CommonInformationEntry<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for FrameDescriptionEntry<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for CompleteLineProgram<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for FileEntry<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for IncompleteLineProgram<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for LineProgramHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for Piece<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, Offset> StructuralPartialEq for UnitHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

source§

impl<R, S> StructuralPartialEq for UnwindTableRow<R, S>
where R: Reader, S: UnwindContextStorage<R>,

1.17.0 · source§

impl<T> StructuralPartialEq for Bound<T>

1.0.0 · source§

impl<T> StructuralPartialEq for Option<T>

1.0.0 · source§

impl<T> StructuralPartialEq for TrySendError<T>

1.36.0 · source§

impl<T> StructuralPartialEq for Poll<T>

source§

impl<T> StructuralPartialEq for UnitSectionOffset<T>

source§

impl<T> StructuralPartialEq for DieReference<T>

source§

impl<T> StructuralPartialEq for &T
where T: ?Sized,

source§

impl<T> StructuralPartialEq for [T]

source§

impl<T> StructuralPartialEq for (T₁, T₂, …, Tₙ)

This trait is implemented for tuples up to twelve items long.

1.19.0 · source§

impl<T> StructuralPartialEq for Reverse<T>

1.0.0 · source§

impl<T> StructuralPartialEq for Cursor<T>

1.20.0 · source§

impl<T> StructuralPartialEq for ManuallyDrop<T>
where T: ?Sized,

source§

impl<T> StructuralPartialEq for NonZero<T>

1.74.0 · source§

impl<T> StructuralPartialEq for Saturating<T>

1.0.0 · source§

impl<T> StructuralPartialEq for Wrapping<T>

1.0.0 · source§

impl<T> StructuralPartialEq for SendError<T>

source§

impl<T> StructuralPartialEq for DebugAbbrevOffset<T>

source§

impl<T> StructuralPartialEq for DebugAddrBase<T>

source§

impl<T> StructuralPartialEq for DebugAddrIndex<T>

source§

impl<T> StructuralPartialEq for DebugArangesOffset<T>

source§

impl<T> StructuralPartialEq for DebugFrameOffset<T>

source§

impl<T> StructuralPartialEq for DebugInfoOffset<T>

source§

impl<T> StructuralPartialEq for DebugLineOffset<T>

source§

impl<T> StructuralPartialEq for DebugLineStrOffset<T>

source§

impl<T> StructuralPartialEq for DebugLocListsBase<T>

source§

impl<T> StructuralPartialEq for DebugLocListsIndex<T>

source§

impl<T> StructuralPartialEq for DebugMacinfoOffset<T>

source§

impl<T> StructuralPartialEq for DebugMacroOffset<T>

source§

impl<T> StructuralPartialEq for DebugRngListsBase<T>

source§

impl<T> StructuralPartialEq for DebugRngListsIndex<T>

source§

impl<T> StructuralPartialEq for DebugStrOffset<T>

source§

impl<T> StructuralPartialEq for DebugStrOffsetsBase<T>

source§

impl<T> StructuralPartialEq for DebugStrOffsetsIndex<T>

source§

impl<T> StructuralPartialEq for DebugTypesOffset<T>

source§

impl<T> StructuralPartialEq for EhFrameOffset<T>

source§

impl<T> StructuralPartialEq for LocationListsOffset<T>

source§

impl<T> StructuralPartialEq for RangeListsOffset<T>

source§

impl<T> StructuralPartialEq for RawRangeListsOffset<T>

source§

impl<T> StructuralPartialEq for UnitOffset<T>

source§

impl<T> StructuralPartialEq for PhantomData<T>
where T: ?Sized,

1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

source§

impl<T, const N: usize> StructuralPartialEq for [T; N]

source§

impl<Y, R> StructuralPartialEq for CoroutineState<Y, R>