@@ -347,18 +347,18 @@ impl Clean<Item> for doctree::Module {
347347 }
348348 }
349349 let items: Vec < Vec < Item > > = vec ! (
350- self . structs. clean( ) . move_iter ( ) . collect ( ) ,
351- self . enums. clean( ) . move_iter ( ) . collect ( ) ,
352- self . fns. clean( ) . move_iter ( ) . collect ( ) ,
350+ self . structs. clean( ) ,
351+ self . enums. clean( ) ,
352+ self . fns. clean( ) ,
353353 foreigns,
354- self . mods. clean( ) . move_iter ( ) . collect ( ) ,
355- self . typedefs. clean( ) . move_iter ( ) . collect ( ) ,
356- self . statics. clean( ) . move_iter ( ) . collect ( ) ,
357- self . traits. clean( ) . move_iter ( ) . collect ( ) ,
358- self . impls. clean( ) . move_iter ( ) . collect ( ) ,
354+ self . mods. clean( ) ,
355+ self . typedefs. clean( ) ,
356+ self . statics. clean( ) ,
357+ self . traits. clean( ) ,
358+ self . impls. clean( ) ,
359359 self . view_items. clean( ) . move_iter( )
360360 . flat_map( |s| s. move_iter( ) ) . collect( ) ,
361- self . macros. clean( ) . move_iter ( ) . collect ( )
361+ self . macros. clean( ) ,
362362 ) ;
363363
364364 // determine if we should display the inner contents or
@@ -406,7 +406,7 @@ impl Clean<Attribute> for ast::MetaItem {
406406 match self . node {
407407 ast:: MetaWord ( ref s) => Word ( s. get ( ) . to_string ( ) ) ,
408408 ast:: MetaList ( ref s, ref l) => {
409- List ( s. get ( ) . to_string ( ) , l. clean ( ) . move_iter ( ) . collect ( ) )
409+ List ( s. get ( ) . to_string ( ) , l. clean ( ) )
410410 }
411411 ast:: MetaNameValue ( ref s, ref v) => {
412412 NameValue ( s. get ( ) . to_string ( ) , lit_to_string ( v) )
@@ -460,7 +460,7 @@ impl Clean<TyParam> for ast::TyParam {
460460 TyParam {
461461 name : self . ident . clean ( ) ,
462462 did : ast:: DefId { krate : ast:: LOCAL_CRATE , node : self . id } ,
463- bounds : self . bounds . clean ( ) . move_iter ( ) . collect ( ) ,
463+ bounds : self . bounds . clean ( ) ,
464464 default : self . default . clean ( )
465465 }
466466 }
@@ -688,7 +688,7 @@ impl Clean<Item> for ast::Method {
688688 } ;
689689 Item {
690690 name : Some ( self . pe_ident ( ) . clean ( ) ) ,
691- attrs : self . attrs . clean ( ) . move_iter ( ) . collect ( ) ,
691+ attrs : self . attrs . clean ( ) ,
692692 source : self . span . clean ( ) ,
693693 def_id : ast_util:: local_def ( self . id ) ,
694694 visibility : self . pe_vis ( ) . clean ( ) ,
@@ -727,7 +727,7 @@ impl Clean<Item> for ast::TypeMethod {
727727 } ;
728728 Item {
729729 name : Some ( self . ident . clean ( ) ) ,
730- attrs : self . attrs . clean ( ) . move_iter ( ) . collect ( ) ,
730+ attrs : self . attrs . clean ( ) ,
731731 source : self . span . clean ( ) ,
732732 def_id : ast_util:: local_def ( self . id ) ,
733733 visibility : None ,
@@ -805,7 +805,7 @@ impl Clean<ClosureDecl> for ast::ClosureTy {
805805 onceness : self . onceness ,
806806 fn_style : self . fn_style ,
807807 bounds : match self . bounds {
808- Some ( ref x) => x. clean ( ) . move_iter ( ) . collect ( ) ,
808+ Some ( ref x) => x. clean ( ) ,
809809 None => Vec :: new ( )
810810 } ,
811811 }
@@ -1178,7 +1178,7 @@ impl Clean<Type> for ast::Ty {
11781178 TyTup ( ref tys) => Tuple ( tys. iter ( ) . map ( |x| x. clean ( ) ) . collect ( ) ) ,
11791179 TyPath ( ref p, ref tpbs, id) => {
11801180 resolve_type ( p. clean ( ) ,
1181- tpbs. clean ( ) . map ( |x| x. move_iter ( ) . collect ( ) ) ,
1181+ tpbs. clean ( ) . map ( |x| x) ,
11821182 id)
11831183 }
11841184 TyClosure ( ref c, region) => Closure ( box c. clean ( ) , region. clean ( ) ) ,
@@ -1307,7 +1307,7 @@ impl Clean<Item> for ast::StructField {
13071307 } ;
13081308 Item {
13091309 name : name. clean ( ) ,
1310- attrs : self . node . attrs . clean ( ) . move_iter ( ) . collect ( ) ,
1310+ attrs : self . node . attrs . clean ( ) ,
13111311 source : self . span . clean ( ) ,
13121312 visibility : Some ( vis) ,
13131313 stability : get_stability ( ast_util:: local_def ( self . node . id ) ) ,
@@ -1320,16 +1320,26 @@ impl Clean<Item> for ast::StructField {
13201320impl Clean < Item > for ty:: field_ty {
13211321 fn clean ( & self ) -> Item {
13221322 use syntax:: parse:: token:: special_idents:: unnamed_field;
1323+ use rustc:: metadata:: csearch;
1324+
1325+ let cx = get_cx ( ) ;
1326+ let attrs;
1327+
1328+ let attr_map = csearch:: get_struct_field_attrs ( & cx. tcx ( ) . sess . cstore , self . id ) ;
1329+
13231330 let name = if self . name == unnamed_field. name {
1331+ attrs = None ;
13241332 None
13251333 } else {
1334+ attrs = Some ( attr_map. find ( & self . id . node ) . unwrap ( ) ) ;
13261335 Some ( self . name )
13271336 } ;
1328- let cx = get_cx ( ) ;
1337+
13291338 let ty = ty:: lookup_item_type ( cx. tcx ( ) , self . id ) ;
1339+
13301340 Item {
13311341 name : name. clean ( ) ,
1332- attrs : inline :: load_attrs ( cx . tcx ( ) , self . id ) ,
1342+ attrs : attrs . unwrap_or ( & Vec :: new ( ) ) . clean ( ) ,
13331343 source : Span :: empty ( ) ,
13341344 visibility : Some ( self . vis ) ,
13351345 stability : get_stability ( self . id ) ,
@@ -1388,7 +1398,7 @@ impl Clean<VariantStruct> for syntax::ast::StructDef {
13881398 fn clean ( & self ) -> VariantStruct {
13891399 VariantStruct {
13901400 struct_type : doctree:: struct_type_from_def ( self ) ,
1391- fields : self . fields . clean ( ) . move_iter ( ) . collect ( ) ,
1401+ fields : self . fields . clean ( ) ,
13921402 fields_stripped : false ,
13931403 }
13941404 }
@@ -1556,7 +1566,7 @@ impl Clean<Path> for ast::Path {
15561566 fn clean ( & self ) -> Path {
15571567 Path {
15581568 global : self . global ,
1559- segments : self . segments . clean ( ) . move_iter ( ) . collect ( ) ,
1569+ segments : self . segments . clean ( ) ,
15601570 }
15611571 }
15621572}
@@ -1572,8 +1582,8 @@ impl Clean<PathSegment> for ast::PathSegment {
15721582 fn clean ( & self ) -> PathSegment {
15731583 PathSegment {
15741584 name : self . identifier . clean ( ) ,
1575- lifetimes : self . lifetimes . clean ( ) . move_iter ( ) . collect ( ) ,
1576- types : self . types . clean ( ) . move_iter ( ) . collect ( )
1585+ lifetimes : self . lifetimes . clean ( ) ,
1586+ types : self . types . clean ( ) ,
15771587 }
15781588 }
15791589}
@@ -1640,7 +1650,7 @@ impl Clean<BareFunctionDecl> for ast::BareFnTy {
16401650 BareFunctionDecl {
16411651 fn_style : self . fn_style ,
16421652 generics : Generics {
1643- lifetimes : self . lifetimes . clean ( ) . move_iter ( ) . collect ( ) ,
1653+ lifetimes : self . lifetimes . clean ( ) ,
16441654 type_params : Vec :: new ( ) ,
16451655 } ,
16461656 decl : self . decl . clean ( ) ,
@@ -1745,7 +1755,7 @@ impl Clean<Vec<Item>> for ast::ViewItem {
17451755 let convert = |node : & ast:: ViewItem_ | {
17461756 Item {
17471757 name : None ,
1748- attrs : self . attrs . clean ( ) . move_iter ( ) . collect ( ) ,
1758+ attrs : self . attrs . clean ( ) ,
17491759 source : self . span . clean ( ) ,
17501760 def_id : ast_util:: local_def ( 0 ) ,
17511761 visibility : self . vis . clean ( ) ,
@@ -1840,7 +1850,7 @@ impl Clean<ViewPath> for ast::ViewPath {
18401850 GlobImport ( resolve_use_source ( p. clean ( ) , id) ) ,
18411851 ast:: ViewPathList ( ref p, ref pl, id) => {
18421852 ImportList ( resolve_use_source ( p. clean ( ) , id) ,
1843- pl. clean ( ) . move_iter ( ) . collect ( ) )
1853+ pl. clean ( ) )
18441854 }
18451855 }
18461856 }
@@ -1893,7 +1903,7 @@ impl Clean<Item> for ast::ForeignItem {
18931903 } ;
18941904 Item {
18951905 name : Some ( self . ident . clean ( ) ) ,
1896- attrs : self . attrs . clean ( ) . move_iter ( ) . collect ( ) ,
1906+ attrs : self . attrs . clean ( ) ,
18971907 source : self . span . clean ( ) ,
18981908 def_id : ast_util:: local_def ( self . id ) ,
18991909 visibility : self . vis . clean ( ) ,
0 commit comments