mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 13:07:37 +00:00
![]() Point at types that need to be marked with `#[derive(PartialEq)]`. We use a visitor to look at a type that isn't structural, looking for all ADTs that don't derive `PartialEq`. These can either be manual `impl PartialEq`s or no `impl` at all, so we differentiate between those two cases to provide more context to the user. We also only point at types and impls from the local crate, otherwise show only a note. ``` error: constant of non-structural type `&[B]` in a pattern --> $DIR/issue-61188-match-slice-forbidden-without-eq.rs:15:9 | LL | struct B(i32); | -------- must be annotated with `#[derive(PartialEq)]` to be usable in patterns LL | LL | const A: &[B] = &[]; | ------------- constant defined here ... LL | A => (), | ^ constant of non-structural type | = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details ``` |
||
---|---|---|
.. | ||
rfc1445 | ||
allow-use-behind-cousin-variant.rs | ||
cant-hide-behind-direct-struct-embedded.rs | ||
cant-hide-behind-direct-struct-embedded.stderr | ||
cant-hide-behind-direct-struct-param.rs | ||
cant-hide-behind-direct-struct-param.stderr | ||
cant-hide-behind-doubly-indirect-embedded.rs | ||
cant-hide-behind-doubly-indirect-embedded.stderr | ||
cant-hide-behind-doubly-indirect-param.rs | ||
cant-hide-behind-doubly-indirect-param.stderr | ||
cant-hide-behind-indirect-struct-embedded.rs | ||
cant-hide-behind-indirect-struct-embedded.stderr | ||
cant-hide-behind-indirect-struct-param.rs | ||
cant-hide-behind-indirect-struct-param.stderr | ||
feature-gate.no_gate.stderr | ||
feature-gate.rs | ||
feature-gate.with_gate.stderr | ||
fn-ptr-is-not-structurally-matchable.rs | ||
fn-ptr-is-not-structurally-matchable.stderr | ||
issue-6804-nan-match.rs | ||
issue-6804-nan-match.stderr | ||
issue-61188-match-slice-forbidden-without-eq.rs | ||
issue-61188-match-slice-forbidden-without-eq.stderr | ||
issue-62307-match-ref-ref-forbidden-without-eq.rs | ||
issue-62307-match-ref-ref-forbidden-without-eq.stderr | ||
issue-63479-match-fnptr.rs | ||
issue-63479-match-fnptr.stderr | ||
match-empty-array-allowed-without-eq-issue-62336.rs | ||
match-requires-both-partialeq-and-eq.rs | ||
match-requires-both-partialeq-and-eq.stderr | ||
phantom-data-is-structurally-matchable.rs |