mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +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 ``` |
||
---|---|---|
.. | ||
auxiliary | ||
accept_structural.rs | ||
cross-crate-fail.rs | ||
cross-crate-fail.stderr | ||
cross-crate-pass.rs | ||
custom-eq-branch-pass.rs | ||
f16-f128-const-reassign.rs | ||
incomplete-slice.rs | ||
incomplete-slice.stderr | ||
issue-34784-match-on-non-int-raw-ptr.rs | ||
issue-34784-match-on-non-int-raw-ptr.stderr | ||
issue-44333.rs | ||
issue-44333.stderr | ||
issue-53708.rs | ||
issue-62614.rs | ||
issue-65466.rs | ||
issue-65466.stderr | ||
issue-73431.rs | ||
no-eq-branch-fail.rs | ||
no-eq-branch-fail.stderr | ||
null-raw-ptr-issue-119270.rs | ||
reject_non_partial_eq.rs | ||
reject_non_partial_eq.stderr | ||
reject_non_structural.rs | ||
reject_non_structural.stderr |