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