@@ -14,7 +14,9 @@ use rustc_middle::ty::{self, TyCtxt};
1414use rustc_span:: hygiene:: MacroKind ;
1515use rustc_span:: symbol:: { kw, sym, Symbol } ;
1616
17- use crate :: clean:: { self , utils, Attributes , AttributesExt , ItemId , NestedAttributesExt , Type } ;
17+ use crate :: clean:: {
18+ self , utils, Attributes , AttributesExt , ImplKind , ItemId , NestedAttributesExt , Type ,
19+ } ;
1820use crate :: core:: DocContext ;
1921use crate :: formats:: item_type:: ItemType ;
2022
@@ -242,7 +244,7 @@ fn build_enum(cx: &mut DocContext<'_>, did: DefId) -> clean::Enum {
242244 clean:: Enum {
243245 generics : ( cx. tcx . generics_of ( did) , predicates) . clean ( cx) ,
244246 variants_stripped : false ,
245- variants : cx. tcx . adt_def ( did) . variants . clean ( cx) ,
247+ variants : cx. tcx . adt_def ( did) . variants . iter ( ) . map ( |v| v . clean ( cx) ) . collect ( ) ,
246248 }
247249}
248250
@@ -253,7 +255,7 @@ fn build_struct(cx: &mut DocContext<'_>, did: DefId) -> clean::Struct {
253255 clean:: Struct {
254256 struct_type : variant. ctor_kind ,
255257 generics : ( cx. tcx . generics_of ( did) , predicates) . clean ( cx) ,
256- fields : variant. fields . clean ( cx) ,
258+ fields : variant. fields . iter ( ) . map ( |x| x . clean ( cx) ) . collect ( ) ,
257259 fields_stripped : false ,
258260 }
259261}
@@ -262,11 +264,9 @@ fn build_union(cx: &mut DocContext<'_>, did: DefId) -> clean::Union {
262264 let predicates = cx. tcx . explicit_predicates_of ( did) ;
263265 let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
264266
265- clean:: Union {
266- generics : ( cx. tcx . generics_of ( did) , predicates) . clean ( cx) ,
267- fields : variant. fields . clean ( cx) ,
268- fields_stripped : false ,
269- }
267+ let generics = ( cx. tcx . generics_of ( did) , predicates) . clean ( cx) ;
268+ let fields = variant. fields . iter ( ) . map ( |x| x. clean ( cx) ) . collect ( ) ;
269+ clean:: Union { generics, fields, fields_stripped : false }
270270}
271271
272272fn build_type_alias ( cx : & mut DocContext < ' _ > , did : DefId ) -> clean:: Typedef {
@@ -446,7 +446,7 @@ crate fn build_impl(
446446 ) ,
447447 } ;
448448 let polarity = tcx. impl_polarity ( did) ;
449- let trait_ = associated_trait. clean ( cx) ;
449+ let trait_ = associated_trait. map ( |t| t . clean ( cx) ) ;
450450 if trait_. as_ref ( ) . map ( |t| t. def_id ( ) ) == tcx. lang_items ( ) . deref_trait ( ) {
451451 super :: build_deref_target_impls ( cx, & trait_items, ret) ;
452452 }
@@ -490,15 +490,13 @@ crate fn build_impl(
490490 did,
491491 None ,
492492 clean:: ImplItem ( clean:: Impl {
493- span : clean:: types:: rustc_span ( did, cx. tcx ) ,
494493 unsafety : hir:: Unsafety :: Normal ,
495494 generics,
496495 trait_,
497496 for_,
498497 items : trait_items,
499- negative_polarity : polarity. clean ( cx) ,
500- synthetic : false ,
501- blanket_impl : None ,
498+ polarity,
499+ kind : ImplKind :: Normal ,
502500 } ) ,
503501 box merged_attrs,
504502 cx,
0 commit comments