diff --git a/crates/hir_def/src/intern.rs b/crates/hir_def/src/intern.rs index 785d9e3c64c..cc0b5d35039 100644 --- a/crates/hir_def/src/intern.rs +++ b/crates/hir_def/src/intern.rs @@ -90,14 +90,16 @@ impl Interned { } /// Compares interned `Ref`s using pointer equality. -impl PartialEq for Interned { +impl PartialEq for Interned { + // NOTE: No `?Sized` because `ptr_eq` doesn't work right with trait objects. + #[inline] fn eq(&self, other: &Self) -> bool { Arc::ptr_eq(&self.arc, &other.arc) } } -impl Eq for Interned {} +impl Eq for Interned {} impl AsRef for Interned { #[inline] @@ -148,7 +150,7 @@ pub trait Internable: Hash + Eq + 'static { } macro_rules! impl_internable { - ( $($t:ty),+ $(,)? ) => { $( + ( $($t:path),+ $(,)? ) => { $( impl Internable for $t { fn storage() -> &'static InternStorage { static STORAGE: InternStorage<$t> = InternStorage::new();