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