aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-02 17:26:34 +0100
committerJonas Schievink <[email protected]>2021-04-02 17:26:34 +0100
commit6e227b80a7686a7ea5bc039d54c307fda29c99ba (patch)
treec52f8464029fb25b619d039b1af431bd85a23a66 /crates/hir_def
parent76452956e4ee3be89a9da69cccadfb980b075049 (diff)
Remove `?Sized` on `PartialEq`/`Eq` impls
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/intern.rs8
1 files changed, 5 insertions, 3 deletions
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<T: Internable + ?Sized> Interned<T> {
90} 90}
91 91
92/// Compares interned `Ref`s using pointer equality. 92/// Compares interned `Ref`s using pointer equality.
93impl<T: Internable + ?Sized> PartialEq for Interned<T> { 93impl<T: Internable> PartialEq for Interned<T> {
94 // NOTE: No `?Sized` because `ptr_eq` doesn't work right with trait objects.
95
94 #[inline] 96 #[inline]
95 fn eq(&self, other: &Self) -> bool { 97 fn eq(&self, other: &Self) -> bool {
96 Arc::ptr_eq(&self.arc, &other.arc) 98 Arc::ptr_eq(&self.arc, &other.arc)
97 } 99 }
98} 100}
99 101
100impl<T: Internable + ?Sized> Eq for Interned<T> {} 102impl<T: Internable> Eq for Interned<T> {}
101 103
102impl<T: Internable + ?Sized> AsRef<T> for Interned<T> { 104impl<T: Internable + ?Sized> AsRef<T> for Interned<T> {
103 #[inline] 105 #[inline]
@@ -148,7 +150,7 @@ pub trait Internable: Hash + Eq + 'static {
148} 150}
149 151
150macro_rules! impl_internable { 152macro_rules! impl_internable {
151 ( $($t:ty),+ $(,)? ) => { $( 153 ( $($t:path),+ $(,)? ) => { $(
152 impl Internable for $t { 154 impl Internable for $t {
153 fn storage() -> &'static InternStorage<Self> { 155 fn storage() -> &'static InternStorage<Self> {
154 static STORAGE: InternStorage<$t> = InternStorage::new(); 156 static STORAGE: InternStorage<$t> = InternStorage::new();