@@ -2816,13 +2816,13 @@ impl<'a> LoweringContext<'a> {
2816
2816
fn lower_async_body (
2817
2817
& mut self ,
2818
2818
decl : & FnDecl ,
2819
- asyncness : IsAsync ,
2819
+ asyncness : & IsAsync ,
2820
2820
body : & Block ,
2821
2821
) -> hir:: BodyId {
2822
2822
self . lower_body ( Some ( decl) , |this| {
2823
2823
if let IsAsync :: Async { closure_id, .. } = asyncness {
2824
2824
let async_expr = this. make_async_expr (
2825
- CaptureBy :: Value , closure_id, None ,
2825
+ CaptureBy :: Value , * closure_id, None ,
2826
2826
|this| {
2827
2827
let body = this. lower_block ( body, false ) ;
2828
2828
this. expr_block ( body, ThinVec :: new ( ) )
@@ -2883,14 +2883,14 @@ impl<'a> LoweringContext<'a> {
2883
2883
value
2884
2884
)
2885
2885
}
2886
- ItemKind :: Fn ( ref decl, header, ref generics, ref body) => {
2886
+ ItemKind :: Fn ( ref decl, ref header, ref generics, ref body) => {
2887
2887
let fn_def_id = self . resolver . definitions ( ) . local_def_id ( id) ;
2888
2888
self . with_new_scopes ( |this| {
2889
2889
// Note: we don't need to change the return type from `T` to
2890
2890
// `impl Future<Output = T>` here because lower_body
2891
2891
// only cares about the input argument patterns in the function
2892
2892
// declaration (decl), not the return types.
2893
- let body_id = this. lower_async_body ( decl, header. asyncness . node , body) ;
2893
+ let body_id = this. lower_async_body ( decl, & header. asyncness . node , body) ;
2894
2894
2895
2895
let ( generics, fn_decl) = this. add_in_band_defs (
2896
2896
generics,
@@ -3391,7 +3391,7 @@ impl<'a> LoweringContext<'a> {
3391
3391
)
3392
3392
}
3393
3393
ImplItemKind :: Method ( ref sig, ref body) => {
3394
- let body_id = self . lower_async_body ( & sig. decl , sig. header . asyncness . node , body) ;
3394
+ let body_id = self . lower_async_body ( & sig. decl , & sig. header . asyncness . node , body) ;
3395
3395
let impl_trait_return_allow = !self . is_in_trait_impl ;
3396
3396
let ( generics, sig) = self . lower_method_sig (
3397
3397
& i. generics ,
@@ -3589,7 +3589,7 @@ impl<'a> LoweringContext<'a> {
3589
3589
impl_trait_return_allow : bool ,
3590
3590
is_async : Option < NodeId > ,
3591
3591
) -> ( hir:: Generics , hir:: MethodSig ) {
3592
- let header = self . lower_fn_header ( sig. header ) ;
3592
+ let header = self . lower_fn_header ( & sig. header ) ;
3593
3593
let ( generics, decl) = self . add_in_band_defs (
3594
3594
generics,
3595
3595
fn_def_id,
@@ -3611,10 +3611,10 @@ impl<'a> LoweringContext<'a> {
3611
3611
}
3612
3612
}
3613
3613
3614
- fn lower_fn_header ( & mut self , h : FnHeader ) -> hir:: FnHeader {
3614
+ fn lower_fn_header ( & mut self , h : & FnHeader ) -> hir:: FnHeader {
3615
3615
hir:: FnHeader {
3616
3616
unsafety : self . lower_unsafety ( h. unsafety ) ,
3617
- asyncness : self . lower_asyncness ( h. asyncness . node ) ,
3617
+ asyncness : self . lower_asyncness ( & h. asyncness . node ) ,
3618
3618
constness : self . lower_constness ( h. constness ) ,
3619
3619
abi : h. abi ,
3620
3620
}
@@ -3634,7 +3634,7 @@ impl<'a> LoweringContext<'a> {
3634
3634
}
3635
3635
}
3636
3636
3637
- fn lower_asyncness ( & mut self , a : IsAsync ) -> hir:: IsAsync {
3637
+ fn lower_asyncness ( & mut self , a : & IsAsync ) -> hir:: IsAsync {
3638
3638
match a {
3639
3639
IsAsync :: Async { .. } => hir:: IsAsync :: Async ,
3640
3640
IsAsync :: NotAsync => hir:: IsAsync :: NotAsync ,
@@ -3947,7 +3947,7 @@ impl<'a> LoweringContext<'a> {
3947
3947
} )
3948
3948
}
3949
3949
ExprKind :: Closure (
3950
- capture_clause, asyncness, movability, ref decl, ref body, fn_decl_span
3950
+ capture_clause, ref asyncness, movability, ref decl, ref body, fn_decl_span
3951
3951
) => {
3952
3952
if let IsAsync :: Async { closure_id, .. } = asyncness {
3953
3953
let outer_decl = FnDecl {
@@ -3985,7 +3985,7 @@ impl<'a> LoweringContext<'a> {
3985
3985
Some ( & * * ty)
3986
3986
} else { None } ;
3987
3987
let async_body = this. make_async_expr (
3988
- capture_clause, closure_id, async_ret_ty,
3988
+ capture_clause, * closure_id, async_ret_ty,
3989
3989
|this| {
3990
3990
this. with_new_scopes ( |this| this. lower_expr ( body) )
3991
3991
} ) ;
0 commit comments