@@ -234,7 +234,6 @@ impl Clean<Item> for doctree::Module<'_> {
234
234
items. extend ( self . foreigns . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
235
235
items. extend ( self . mods . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
236
236
items. extend ( self . items . iter ( ) . map ( |x| x. clean ( cx) ) . flatten ( ) ) ;
237
- items. extend ( self . traits . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
238
237
items. extend ( self . macros . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
239
238
240
239
// determine if we should display the inner contents or
@@ -1022,26 +1021,6 @@ impl Clean<FnRetTy> for hir::FnRetTy<'_> {
1022
1021
}
1023
1022
}
1024
1023
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
-
1045
1024
impl Clean < bool > for hir:: IsAuto {
1046
1025
fn clean ( & self , _: & DocContext < ' _ > ) -> bool {
1047
1026
match * self {
@@ -2011,6 +1990,20 @@ impl Clean<Vec<Item>> for (&hir::Item<'_>, Option<Ident>) {
2011
1990
ItemKind :: Fn ( ref sig, ref generics, body_id) => {
2012
1991
clean_fn_or_proc_macro ( item, sig, generics, body_id, & mut name, cx)
2013
1992
}
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
+ }
2014
2007
_ => unreachable ! ( "not yet converted" ) ,
2015
2008
} ;
2016
2009
0 commit comments