@@ -268,8 +268,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
268
268
// only cares about the input argument patterns in the function
269
269
// declaration (decl), not the return types.
270
270
let asyncness = header. asyncness ;
271
- let body_id =
272
- this. lower_maybe_async_body ( span, & decl, asyncness, body. as_deref ( ) ) ;
271
+ let body_id = this. lower_maybe_async_body (
272
+ span,
273
+ hir_id,
274
+ & decl,
275
+ asyncness,
276
+ body. as_deref ( ) ,
277
+ ) ;
273
278
274
279
let mut itctx = ImplTraitContext :: Universal ;
275
280
let ( generics, decl) = this. lower_generics ( generics, id, & mut itctx, |this| {
@@ -789,7 +794,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
789
794
AssocItemKind :: Fn ( box Fn { sig, generics, body : Some ( body) , .. } ) => {
790
795
let asyncness = sig. header . asyncness ;
791
796
let body_id =
792
- self . lower_maybe_async_body ( i. span , & sig. decl , asyncness, Some ( & body) ) ;
797
+ self . lower_maybe_async_body ( i. span , hir_id , & sig. decl , asyncness, Some ( & body) ) ;
793
798
let ( generics, sig) = self . lower_method_sig (
794
799
generics,
795
800
sig,
@@ -863,6 +868,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
863
868
// Since `default impl` is not yet implemented, this is always true in impls.
864
869
let has_value = true ;
865
870
let ( defaultness, _) = self . lower_defaultness ( i. kind . defaultness ( ) , has_value) ;
871
+ let hir_id = self . lower_node_id ( i. id ) ;
866
872
867
873
let ( generics, kind) = match & i. kind {
868
874
AssocItemKind :: Const ( _, ty, expr) => {
@@ -875,8 +881,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
875
881
AssocItemKind :: Fn ( box Fn { sig, generics, body, .. } ) => {
876
882
self . current_item = Some ( i. span ) ;
877
883
let asyncness = sig. header . asyncness ;
878
- let body_id =
879
- self . lower_maybe_async_body ( i. span , & sig. decl , asyncness, body. as_deref ( ) ) ;
884
+ let body_id = self . lower_maybe_async_body (
885
+ i. span ,
886
+ hir_id,
887
+ & sig. decl ,
888
+ asyncness,
889
+ body. as_deref ( ) ,
890
+ ) ;
880
891
let ( generics, sig) = self . lower_method_sig (
881
892
generics,
882
893
sig,
@@ -909,7 +920,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
909
920
AssocItemKind :: MacCall ( ..) => panic ! ( "`TyMac` should have been expanded by now" ) ,
910
921
} ;
911
922
912
- let hir_id = self . lower_node_id ( i. id ) ;
913
923
self . lower_attrs ( hir_id, & i. attrs ) ;
914
924
let item = hir:: ImplItem {
915
925
owner_id : hir_id. expect_owner ( ) ,
@@ -1043,6 +1053,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1043
1053
fn lower_maybe_async_body (
1044
1054
& mut self ,
1045
1055
span : Span ,
1056
+ fn_id : hir:: HirId ,
1046
1057
decl : & FnDecl ,
1047
1058
asyncness : Async ,
1048
1059
body : Option < & Block > ,
@@ -1193,6 +1204,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1193
1204
1194
1205
let async_expr = this. make_async_expr (
1195
1206
CaptureBy :: Value ,
1207
+ Some ( fn_id) ,
1196
1208
closure_id,
1197
1209
None ,
1198
1210
body. span ,
0 commit comments