Skip to content

Commit f2bdaf1

Browse files
committed
Remove structural match from TypeId.
1 parent cade266 commit f2bdaf1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

library/core/src/any.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -662,12 +662,20 @@ impl dyn Any + Send + Sync {
662662
/// While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth
663663
/// noting that the hashes and ordering will vary between Rust releases. Beware
664664
/// of relying on them inside of your code!
665-
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
665+
#[derive(Clone, Copy, Debug, Hash, Eq, PartialOrd, Ord)]
666666
#[stable(feature = "rust1", since = "1.0.0")]
667667
pub struct TypeId {
668668
t: u64,
669669
}
670670

671+
#[stable(feature = "rust1", since = "1.0.0")]
672+
impl PartialEq for TypeId {
673+
#[inline]
674+
fn eq(&self, other: &Self) -> bool {
675+
self.t == other.t
676+
}
677+
}
678+
671679
impl TypeId {
672680
/// Returns the `TypeId` of the type this generic function has been
673681
/// instantiated with.

0 commit comments

Comments
 (0)