From 6e227b80a7686a7ea5bc039d54c307fda29c99ba Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 2 Apr 2021 18:26:34 +0200 Subject: Remove `?Sized` on `PartialEq`/`Eq` impls --- crates/hir_def/src/intern.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/hir_def/src/intern.rs b/crates/hir_def/src/intern.rs index 785d9e3c6..cc0b5d350 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(); -- cgit v1.2.3