Skip to content

Commit 6e227b8

Browse files
Remove ?Sized on PartialEq/Eq impls
1 parent 7645295 commit 6e227b8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/hir_def/src/intern.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,16 @@ impl<T: Internable + ?Sized> Interned<T> {
9090
}
9191

9292
/// 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+
9496
#[inline]
9597
fn eq(&self, other: &Self) -> bool {
9698
Arc::ptr_eq(&self.arc, &other.arc)
9799
}
98100
}
99101

100-
impl<T: Internable + ?Sized> Eq for Interned<T> {}
102+
impl<T: Internable> Eq for Interned<T> {}
101103

102104
impl<T: Internable + ?Sized> AsRef<T> for Interned<T> {
103105
#[inline]
@@ -148,7 +150,7 @@ pub trait Internable: Hash + Eq + 'static {
148150
}
149151

150152
macro_rules! impl_internable {
151-
( $($t:ty),+ $(,)? ) => { $(
153+
( $($t:path),+ $(,)? ) => { $(
152154
impl Internable for $t {
153155
fn storage() -> &'static InternStorage<Self> {
154156
static STORAGE: InternStorage<$t> = InternStorage::new();

0 commit comments

Comments
 (0)