File tree 1 file changed +10
-4
lines changed
src/librustdoc/html/render
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,15 @@ impl SharedContext<'_> {
159
159
) -> Vec < & ' a formats:: Impl > {
160
160
let tcx = self . tcx ;
161
161
let cache = & self . cache ;
162
- let mut v: Vec < & formats:: Impl > =
163
- cache. impls . get ( & did) . map ( Vec :: as_slice) . unwrap_or ( & [ ] ) . iter ( ) . collect ( ) ;
162
+ let mut saw_impls = FxHashSet :: default ( ) ;
163
+ let mut v: Vec < & formats:: Impl > = cache
164
+ . impls
165
+ . get ( & did)
166
+ . map ( Vec :: as_slice)
167
+ . unwrap_or ( & [ ] )
168
+ . iter ( )
169
+ . filter ( |i| saw_impls. insert ( i. def_id ( ) ) )
170
+ . collect ( ) ;
164
171
if let TypeAliasItem ( ait) = & * it. kind &&
165
172
let aliased_clean_type = ait. item_type . as_ref ( ) . unwrap_or ( & ait. type_ ) &&
166
173
let Some ( aliased_type_defid) = aliased_clean_type. def_id ( cache) &&
@@ -181,13 +188,12 @@ impl SharedContext<'_> {
181
188
v. extend ( av. iter ( ) . filter ( |impl_| {
182
189
if let Some ( impl_def_id) = impl_. impl_item . item_id . as_def_id ( ) {
183
190
reject_cx. types_may_unify ( aliased_ty, tcx. type_of ( impl_def_id) . skip_binder ( ) )
191
+ && saw_impls. insert ( impl_def_id)
184
192
} else {
185
193
false
186
194
}
187
195
} ) ) ;
188
196
}
189
- let mut saw_impls = FxHashSet :: default ( ) ;
190
- v. retain ( |i| saw_impls. insert ( i. def_id ( ) ) ) ;
191
197
v
192
198
}
193
199
}
You can’t perform that action at this time.
0 commit comments