about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/any.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index d1c1ae6526b..7969f4055dd 100644
--- a/library/core/src/any.rs
+++ b/library/core/src/any.rs
@@ -662,12 +662,20 @@ impl dyn Any + Send + Sync {
 /// While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth
 /// noting that the hashes and ordering will vary between Rust releases. Beware
 /// of relying on them inside of your code!
-#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
+#[derive(Clone, Copy, Debug, Hash, Eq, PartialOrd, Ord)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct TypeId {
     t: u64,
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl PartialEq for TypeId {
+    #[inline]
+    fn eq(&self, other: &Self) -> bool {
+        self.t == other.t
+    }
+}
+
 impl TypeId {
     /// Returns the `TypeId` of the type this generic function has been
     /// instantiated with.