@@ -576,9 +576,9 @@ impl Clean<Item> for doctree::Module {
576576 let mut items: Vec < Item > = vec ! [ ] ;
577577 items. extend ( self . extern_crates . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
578578 items. extend ( self . imports . iter ( ) . flat_map ( |x| x. clean ( cx) ) ) ;
579- items. extend ( self . structs . iter ( ) . flat_map ( |x| x. clean ( cx) ) ) ;
580- items. extend ( self . unions . iter ( ) . flat_map ( |x| x. clean ( cx) ) ) ;
581- items. extend ( self . enums . iter ( ) . flat_map ( |x| x. clean ( cx) ) ) ;
579+ items. extend ( self . structs . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
580+ items. extend ( self . unions . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
581+ items. extend ( self . enums . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
582582 items. extend ( self . fns . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
583583 items. extend ( self . foreigns . iter ( ) . flat_map ( |x| x. clean ( cx) ) ) ;
584584 items. extend ( self . mods . iter ( ) . map ( |x| x. clean ( cx) ) ) ;
@@ -2813,14 +2813,10 @@ pub struct Union {
28132813 pub fields_stripped : bool ,
28142814}
28152815
2816- impl Clean < Vec < Item > > for doctree:: Struct {
2817- fn clean ( & self , cx : & DocContext ) -> Vec < Item > {
2818- let name = self . name . clean ( cx) ;
2819- let mut ret = get_auto_traits_with_node_id ( cx, self . id , name. clone ( ) ) ;
2820- ret. extend ( get_blanket_impls_with_node_id ( cx, self . id , name. clone ( ) ) ) ;
2821-
2822- ret. push ( Item {
2823- name : Some ( name) ,
2816+ impl Clean < Item > for doctree:: Struct {
2817+ fn clean ( & self , cx : & DocContext ) -> Item {
2818+ Item {
2819+ name : Some ( self . name . clean ( cx) ) ,
28242820 attrs : self . attrs . clean ( cx) ,
28252821 source : self . whence . clean ( cx) ,
28262822 def_id : cx. tcx . hir . local_def_id ( self . id ) ,
@@ -2833,20 +2829,14 @@ impl Clean<Vec<Item>> for doctree::Struct {
28332829 fields : self . fields . clean ( cx) ,
28342830 fields_stripped : false ,
28352831 } ) ,
2836- } ) ;
2837-
2838- ret
2832+ }
28392833 }
28402834}
28412835
2842- impl Clean < Vec < Item > > for doctree:: Union {
2843- fn clean ( & self , cx : & DocContext ) -> Vec < Item > {
2844- let name = self . name . clean ( cx) ;
2845- let mut ret = get_auto_traits_with_node_id ( cx, self . id , name. clone ( ) ) ;
2846- ret. extend ( get_blanket_impls_with_node_id ( cx, self . id , name. clone ( ) ) ) ;
2847-
2848- ret. push ( Item {
2849- name : Some ( name) ,
2836+ impl Clean < Item > for doctree:: Union {
2837+ fn clean ( & self , cx : & DocContext ) -> Item {
2838+ Item {
2839+ name : Some ( self . name . clean ( cx) ) ,
28502840 attrs : self . attrs . clean ( cx) ,
28512841 source : self . whence . clean ( cx) ,
28522842 def_id : cx. tcx . hir . local_def_id ( self . id ) ,
@@ -2859,9 +2849,7 @@ impl Clean<Vec<Item>> for doctree::Union {
28592849 fields : self . fields . clean ( cx) ,
28602850 fields_stripped : false ,
28612851 } ) ,
2862- } ) ;
2863-
2864- ret
2852+ }
28652853 }
28662854}
28672855
@@ -2892,14 +2880,10 @@ pub struct Enum {
28922880 pub variants_stripped : bool ,
28932881}
28942882
2895- impl Clean < Vec < Item > > for doctree:: Enum {
2896- fn clean ( & self , cx : & DocContext ) -> Vec < Item > {
2897- let name = self . name . clean ( cx) ;
2898- let mut ret = get_auto_traits_with_node_id ( cx, self . id , name. clone ( ) ) ;
2899- ret. extend ( get_blanket_impls_with_node_id ( cx, self . id , name. clone ( ) ) ) ;
2900-
2901- ret. push ( Item {
2902- name : Some ( name) ,
2883+ impl Clean < Item > for doctree:: Enum {
2884+ fn clean ( & self , cx : & DocContext ) -> Item {
2885+ Item {
2886+ name : Some ( self . name . clean ( cx) ) ,
29032887 attrs : self . attrs . clean ( cx) ,
29042888 source : self . whence . clean ( cx) ,
29052889 def_id : cx. tcx . hir . local_def_id ( self . id ) ,
@@ -2911,9 +2895,7 @@ impl Clean<Vec<Item>> for doctree::Enum {
29112895 generics : self . generics . clean ( cx) ,
29122896 variants_stripped : false ,
29132897 } ) ,
2914- } ) ;
2915-
2916- ret
2898+ }
29172899 }
29182900}
29192901
@@ -3442,11 +3424,7 @@ fn build_deref_target_impls(cx: &DocContext,
34423424 let primitive = match * target {
34433425 ResolvedPath { did, .. } if did. is_local ( ) => continue ,
34443426 ResolvedPath { did, .. } => {
3445- // We set the last parameter to false to avoid looking for auto-impls for traits
3446- // and therefore avoid an ICE.
3447- // The reason behind this is that auto-traits don't propagate through Deref so
3448- // we're not supposed to synthesise impls for them.
3449- ret. extend ( inline:: build_impls ( cx, did, false ) ) ;
3427+ ret. extend ( inline:: build_impls ( cx, did) ) ;
34503428 continue
34513429 }
34523430 _ => match target. primitive_type ( ) {
0 commit comments