Skip to content

Commit bb121d1

Browse files
committed
Auto merge of rust-lang#116167 - RalfJung:structural-eq, r=lcnr
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
2 parents d645e16 + 215284a commit bb121d1

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

example/mini_core.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
100100
#[lang = "structural_peq"]
101101
pub trait StructuralPartialEq {}
102102

103-
#[lang = "structural_teq"]
104-
pub trait StructuralEq {}
105-
106103
#[lang = "not"]
107104
pub trait Not {
108105
type Output;

tests/run/static.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ mod libc {
6161
#[lang = "structural_peq"]
6262
pub trait StructuralPartialEq {}
6363

64-
#[lang = "structural_teq"]
65-
pub trait StructuralEq {}
66-
6764
#[lang = "drop_in_place"]
6865
#[allow(unconditional_recursion)]
6966
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {

0 commit comments

Comments
 (0)