about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-02-17 13:43:38 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-04-27 14:37:42 +0000
commit518d348f873ac5df4ca43b36145e5556138adad3 (patch)
tree05e47979da8a4baea53b76036bb774da66a286e2
parent91b61a4ad618c1abc2af43a58695de185ef1e513 (diff)
downloadrust-518d348f873ac5df4ca43b36145e5556138adad3.tar.gz
rust-518d348f873ac5df4ca43b36145e5556138adad3.zip
Implement `StructuralEq` for integers, `bool` and `char`
(how did this work before??)
-rw-r--r--library/core/src/marker.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index e85c0c0a688..1d33236c269 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -214,6 +214,35 @@ pub trait StructuralEq {
     // Empty.
 }
 
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for usize {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for u8 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for u16 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for u32 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for u64 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for u128 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for isize {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for i8 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for i16 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for i32 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for i64 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for i128 {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for bool {}
+#[unstable(feature = "structural_match", issue = "31434")]
+impl StructuralEq for char {}
+
 /// Types whose values can be duplicated simply by copying bits.
 ///
 /// By default, variable bindings have 'move semantics.' In other