Skip to content

Commit

Permalink
Auto merge of rust-lang#116167 - RalfJung:structural-eq, r=lcnr
Browse files Browse the repository at this point in the history
remove StructuralEq trait

The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more.

One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust rust-lang#115893 to check for `Eq`, and rule out float matching for good.

Fixes rust-lang#115881
  • Loading branch information
bors committed Jan 26, 2024
2 parents 0b6cf3b + 99d8d33 commit a65fe78
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions tests/ui/crashes/ice-6254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ fn main() {
// This used to cause an ICE (https://github.com/rust-lang/rust/issues/78071)
match FOO_REF_REF {
FOO_REF_REF => {},
//~^ ERROR: to use a constant of type `Foo` in a pattern, `Foo` must be annotated
//~| NOTE: for more information, see issue #62411 <https://github.com/rust-lang/ru
Foo(_) => {},
}
}
15 changes: 0 additions & 15 deletions tests/ui/crashes/ice-6254.stderr

This file was deleted.

0 comments on commit a65fe78

Please sign in to comment.