File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,15 @@ impl SharedContext<'_> {
159159 ) -> Vec < & ' a formats:: Impl > {
160160 let tcx = self . tcx ;
161161 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 ( ) ;
164171 if let TypeAliasItem ( ait) = & * it. kind &&
165172 let aliased_clean_type = ait. item_type . as_ref ( ) . unwrap_or ( & ait. type_ ) &&
166173 let Some ( aliased_type_defid) = aliased_clean_type. def_id ( cache) &&
@@ -181,13 +188,12 @@ impl SharedContext<'_> {
181188 v. extend ( av. iter ( ) . filter ( |impl_| {
182189 if let Some ( impl_def_id) = impl_. impl_item . item_id . as_def_id ( ) {
183190 reject_cx. types_may_unify ( aliased_ty, tcx. type_of ( impl_def_id) . skip_binder ( ) )
191+ && saw_impls. insert ( impl_def_id)
184192 } else {
185193 false
186194 }
187195 } ) ) ;
188196 }
189- let mut saw_impls = FxHashSet :: default ( ) ;
190- v. retain ( |i| saw_impls. insert ( i. def_id ( ) ) ) ;
191197 v
192198 }
193199}
You can’t perform that action at this time.
0 commit comments