Enforce T: Hash for Interned<...>
This adds panicking Hash impls for several resolver types that don't actually satisfy this condition. It's not obvious to me that rustc_resolve actually upholds the Interned guarantees but fixing that seems pretty hard (the structures have at minimum some interior mutability, so it's not really recursively hashable in place...).
This commit is contained in:
@@ -92,7 +92,10 @@ impl<'a, T: Ord> Ord for Interned<'a, T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> Hash for Interned<'a, T> {
|
||||
impl<'a, T> Hash for Interned<'a, T>
|
||||
where
|
||||
T: Hash,
|
||||
{
|
||||
#[inline]
|
||||
fn hash<H: Hasher>(&self, s: &mut H) {
|
||||
// Pointer hashing is sufficient, due to the uniqueness constraint.
|
||||
|
||||
Reference in New Issue
Block a user