@@ -14,7 +14,9 @@ use rustc_middle::ty::{self, TyCtxt};
14
14
use rustc_span:: hygiene:: MacroKind ;
15
15
use rustc_span:: symbol:: { kw, sym, Symbol } ;
16
16
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
+ } ;
18
20
use crate :: core:: DocContext ;
19
21
use crate :: formats:: item_type:: ItemType ;
20
22
@@ -242,7 +244,7 @@ fn build_enum(cx: &mut DocContext<'_>, did: DefId) -> clean::Enum {
242
244
clean:: Enum {
243
245
generics : ( cx. tcx . generics_of ( did) , predicates) . clean ( cx) ,
244
246
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 ( ) ,
246
248
}
247
249
}
248
250
@@ -253,7 +255,7 @@ fn build_struct(cx: &mut DocContext<'_>, did: DefId) -> clean::Struct {
253
255
clean:: Struct {
254
256
struct_type : variant. ctor_kind ,
255
257
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 ( ) ,
257
259
fields_stripped : false ,
258
260
}
259
261
}
@@ -262,11 +264,9 @@ fn build_union(cx: &mut DocContext<'_>, did: DefId) -> clean::Union {
262
264
let predicates = cx. tcx . explicit_predicates_of ( did) ;
263
265
let variant = cx. tcx . adt_def ( did) . non_enum_variant ( ) ;
264
266
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 }
270
270
}
271
271
272
272
fn build_type_alias ( cx : & mut DocContext < ' _ > , did : DefId ) -> clean:: Typedef {
@@ -446,7 +446,7 @@ crate fn build_impl(
446
446
) ,
447
447
} ;
448
448
let polarity = tcx. impl_polarity ( did) ;
449
- let trait_ = associated_trait. clean ( cx) ;
449
+ let trait_ = associated_trait. map ( |t| t . clean ( cx) ) ;
450
450
if trait_. as_ref ( ) . map ( |t| t. def_id ( ) ) == tcx. lang_items ( ) . deref_trait ( ) {
451
451
super :: build_deref_target_impls ( cx, & trait_items, ret) ;
452
452
}
@@ -490,15 +490,13 @@ crate fn build_impl(
490
490
did,
491
491
None ,
492
492
clean:: ImplItem ( clean:: Impl {
493
- span : clean:: types:: rustc_span ( did, cx. tcx ) ,
494
493
unsafety : hir:: Unsafety :: Normal ,
495
494
generics,
496
495
trait_,
497
496
for_,
498
497
items : trait_items,
499
- negative_polarity : polarity. clean ( cx) ,
500
- synthetic : false ,
501
- blanket_impl : None ,
498
+ polarity,
499
+ kind : ImplKind :: Normal ,
502
500
} ) ,
503
501
box merged_attrs,
504
502
cx,
0 commit comments