diff options
author | Jonas Schievink <[email protected]> | 2021-04-02 17:26:34 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-02 17:26:34 +0100 |
commit | 6e227b80a7686a7ea5bc039d54c307fda29c99ba (patch) | |
tree | c52f8464029fb25b619d039b1af431bd85a23a66 /crates | |
parent | 76452956e4ee3be89a9da69cccadfb980b075049 (diff) |
Remove `?Sized` on `PartialEq`/`Eq` impls
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_def/src/intern.rs | 8 |
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. |
93 | impl<T: Internable + ?Sized> PartialEq for Interned<T> { | 93 | impl<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 | ||
100 | impl<T: Internable + ?Sized> Eq for Interned<T> {} | 102 | impl<T: Internable> Eq for Interned<T> {} |
101 | 103 | ||
102 | impl<T: Internable + ?Sized> AsRef<T> for Interned<T> { | 104 | impl<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 | ||
150 | macro_rules! impl_internable { | 152 | macro_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(); |