@@ -3081,8 +3081,12 @@ impl<'a> LoweringContext<'a> {
30813081 fn lower_impl_trait_ids (
30823082 & mut self ,
30833083 decl : & FnDecl ,
3084+ header : & FnHeader ,
30843085 ids : & mut SmallVector < hir:: ItemId > ,
30853086 ) {
3087+ if let Some ( id) = header. asyncness . opt_return_id ( ) {
3088+ ids. push ( hir:: ItemId { id } ) ;
3089+ }
30863090 struct IdVisitor < ' a > { ids : & ' a mut SmallVector < hir:: ItemId > }
30873091 impl < ' a , ' b > Visitor < ' a > for IdVisitor < ' b > {
30883092 fn visit_ty ( & mut self , ty : & ' a Ty ) {
@@ -3126,20 +3130,14 @@ impl<'a> LoweringContext<'a> {
31263130 ItemKind :: MacroDef ( ..) => SmallVector :: new ( ) ,
31273131 ItemKind :: Fn ( ref decl, ref header, ..) => {
31283132 let mut ids = SmallVector :: one ( hir:: ItemId { id : i. id } ) ;
3129- if let Some ( id) = header. asyncness . opt_return_id ( ) {
3130- ids. push ( hir:: ItemId { id } ) ;
3131- }
3132- self . lower_impl_trait_ids ( decl, & mut ids) ;
3133+ self . lower_impl_trait_ids ( decl, header, & mut ids) ;
31333134 ids
31343135 } ,
31353136 ItemKind :: Impl ( .., None , _, ref items) => {
31363137 let mut ids = SmallVector :: one ( hir:: ItemId { id : i. id } ) ;
31373138 for item in items {
31383139 if let ImplItemKind :: Method ( ref sig, _) = item. node {
3139- if let Some ( id) = sig. header . asyncness . opt_return_id ( ) {
3140- ids. push ( hir:: ItemId { id } ) ;
3141- }
3142- self . lower_impl_trait_ids ( & sig. decl , & mut ids) ;
3140+ self . lower_impl_trait_ids ( & sig. decl , & sig. header , & mut ids) ;
31433141 }
31443142 }
31453143 ids
0 commit comments