@@ -234,7 +234,6 @@ impl Clean<Item> for doctree::Module<'_> {
234234 items. extend ( self . foreigns . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
235235 items. extend ( self . mods . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
236236 items. extend ( self . items . iter ( ) . map ( |x| x. clean ( cx) ) . flatten ( ) ) ;
237- items. extend ( self . traits . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
238237 items. extend ( self . macros . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
239238
240239 // determine if we should display the inner contents or
@@ -1022,26 +1021,6 @@ impl Clean<FnRetTy> for hir::FnRetTy<'_> {
10221021 }
10231022}
10241023
1025- impl Clean < Item > for doctree:: Trait < ' _ > {
1026- fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
1027- let attrs = self . attrs . clean ( cx) ;
1028- let is_spotlight = attrs. has_doc_flag ( sym:: spotlight) ;
1029- Item :: from_hir_id_and_parts (
1030- self . id ,
1031- Some ( self . name ) ,
1032- TraitItem ( Trait {
1033- unsafety : self . unsafety ,
1034- items : self . items . iter ( ) . map ( |ti| ti. clean ( cx) ) . collect ( ) ,
1035- generics : self . generics . clean ( cx) ,
1036- bounds : self . bounds . clean ( cx) ,
1037- is_spotlight,
1038- is_auto : self . is_auto . clean ( cx) ,
1039- } ) ,
1040- cx,
1041- )
1042- }
1043- }
1044-
10451024impl Clean < bool > for hir:: IsAuto {
10461025 fn clean ( & self , _: & DocContext < ' _ > ) -> bool {
10471026 match * self {
@@ -2011,6 +1990,20 @@ impl Clean<Vec<Item>> for (&hir::Item<'_>, Option<Ident>) {
20111990 ItemKind :: Fn ( ref sig, ref generics, body_id) => {
20121991 clean_fn_or_proc_macro ( item, sig, generics, body_id, & mut name, cx)
20131992 }
1993+ hir:: ItemKind :: Trait ( is_auto, unsafety, ref generics, ref bounds, ref item_ids) => {
1994+ let items =
1995+ item_ids. iter ( ) . map ( |ti| cx. tcx . hir ( ) . trait_item ( ti. id ) . clean ( cx) ) . collect ( ) ;
1996+ let attrs = item. attrs . clean ( cx) ;
1997+ let is_spotlight = attrs. has_doc_flag ( sym:: spotlight) ;
1998+ TraitItem ( Trait {
1999+ unsafety,
2000+ items,
2001+ generics : generics. clean ( cx) ,
2002+ bounds : bounds. clean ( cx) ,
2003+ is_spotlight,
2004+ is_auto : is_auto. clean ( cx) ,
2005+ } )
2006+ }
20142007 _ => unreachable ! ( "not yet converted" ) ,
20152008 } ;
20162009
0 commit comments