about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-26 00:17:00 +0000
committerbors <bors@rust-lang.org>2024-01-26 00:17:00 +0000
commitdd2559e08e1530806740931037d6bb83ef956161 (patch)
tree1c6e468a3101e3eb9b47e15e68d8ac3c62c5f139 /compiler/rustc_codegen_cranelift
parent0c1fb2a1e65a57073dc62dd502319a00cf753371 (diff)
parent0df7810734d396d1a3082eee674d542c81c269d2 (diff)
downloadrust-dd2559e08e1530806740931037d6bb83ef956161.tar.gz
rust-dd2559e08e1530806740931037d6bb83ef956161.zip
Auto merge of #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 https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good.

Fixes https://github.com/rust-lang/rust/issues/115881
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/example/mini_core.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/mini_core.rs b/compiler/rustc_codegen_cranelift/example/mini_core.rs
index 3607b7cd944..a79909ce0c8 100644
--- a/compiler/rustc_codegen_cranelift/example/mini_core.rs
+++ b/compiler/rustc_codegen_cranelift/example/mini_core.rs
@@ -104,9 +104,6 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
 #[lang = "structural_peq"]
 pub trait StructuralPartialEq {}
 
-#[lang = "structural_teq"]
-pub trait StructuralEq {}
-
 #[lang = "not"]
 pub trait Not {
     type Output;