@@ -3081,8 +3081,12 @@ impl<'a> LoweringContext<'a> {
3081
3081
fn lower_impl_trait_ids (
3082
3082
& mut self ,
3083
3083
decl : & FnDecl ,
3084
+ header : & FnHeader ,
3084
3085
ids : & mut SmallVector < hir:: ItemId > ,
3085
3086
) {
3087
+ if let Some ( id) = header. asyncness . opt_return_id ( ) {
3088
+ ids. push ( hir:: ItemId { id } ) ;
3089
+ }
3086
3090
struct IdVisitor < ' a > { ids : & ' a mut SmallVector < hir:: ItemId > }
3087
3091
impl < ' a , ' b > Visitor < ' a > for IdVisitor < ' b > {
3088
3092
fn visit_ty ( & mut self , ty : & ' a Ty ) {
@@ -3126,20 +3130,14 @@ impl<'a> LoweringContext<'a> {
3126
3130
ItemKind :: MacroDef ( ..) => SmallVector :: new ( ) ,
3127
3131
ItemKind :: Fn ( ref decl, ref header, ..) => {
3128
3132
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) ;
3133
3134
ids
3134
3135
} ,
3135
3136
ItemKind :: Impl ( .., None , _, ref items) => {
3136
3137
let mut ids = SmallVector :: one ( hir:: ItemId { id : i. id } ) ;
3137
3138
for item in items {
3138
3139
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) ;
3143
3141
}
3144
3142
}
3145
3143
ids
0 commit comments