File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,16 @@ impl<T: Internable + ?Sized> Interned<T> {
90
90
}
91
91
92
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
96
#[ inline]
95
97
fn eq ( & self , other : & Self ) -> bool {
96
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
104
impl < T : Internable + ?Sized > AsRef < T > for Interned < T > {
103
105
#[ inline]
@@ -148,7 +150,7 @@ pub trait Internable: Hash + Eq + 'static {
148
150
}
149
151
150
152
macro_rules! impl_internable {
151
- ( $( $t: ty ) ,+ $( , ) ? ) => { $(
153
+ ( $( $t: path ) ,+ $( , ) ? ) => { $(
152
154
impl Internable for $t {
153
155
fn storage( ) -> & ' static InternStorage <Self > {
154
156
static STORAGE : InternStorage <$t> = InternStorage :: new( ) ;
You can’t perform that action at this time.
0 commit comments