Another issue is that by the time the type_id intrinsic is called, all lifetimes are already erased. This means that it is impossible to give &'static u8
a different TypeId fron &'a u8
. It would only be possible to use the TypeId::Static
variant for types that don't have any lifetime parameters at all.
Eq
requires the relation to be reflexive, in other words it requires x == x
to hold for all x
. This property is why we have Eq
in the first place instead of just PartialEq
, which doesn't require this.