@@ -2816,13 +2816,13 @@ impl<'a> LoweringContext<'a> {
28162816 fn lower_async_body (
28172817 & mut self ,
28182818 decl : & FnDecl ,
2819- asyncness : IsAsync ,
2819+ asyncness : & IsAsync ,
28202820 body : & Block ,
28212821 ) -> hir:: BodyId {
28222822 self . lower_body ( Some ( decl) , |this| {
28232823 if let IsAsync :: Async { closure_id, .. } = asyncness {
28242824 let async_expr = this. make_async_expr (
2825- CaptureBy :: Value , closure_id, None ,
2825+ CaptureBy :: Value , * closure_id, None ,
28262826 |this| {
28272827 let body = this. lower_block ( body, false ) ;
28282828 this. expr_block ( body, ThinVec :: new ( ) )
@@ -2883,14 +2883,14 @@ impl<'a> LoweringContext<'a> {
28832883 value
28842884 )
28852885 }
2886- ItemKind :: Fn ( ref decl, header, ref generics, ref body) => {
2886+ ItemKind :: Fn ( ref decl, ref header, ref generics, ref body) => {
28872887 let fn_def_id = self . resolver . definitions ( ) . local_def_id ( id) ;
28882888 self . with_new_scopes ( |this| {
28892889 // Note: we don't need to change the return type from `T` to
28902890 // `impl Future<Output = T>` here because lower_body
28912891 // only cares about the input argument patterns in the function
28922892 // 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) ;
28942894
28952895 let ( generics, fn_decl) = this. add_in_band_defs (
28962896 generics,
@@ -3391,7 +3391,7 @@ impl<'a> LoweringContext<'a> {
33913391 )
33923392 }
33933393 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) ;
33953395 let impl_trait_return_allow = !self . is_in_trait_impl ;
33963396 let ( generics, sig) = self . lower_method_sig (
33973397 & i. generics ,
@@ -3589,7 +3589,7 @@ impl<'a> LoweringContext<'a> {
35893589 impl_trait_return_allow : bool ,
35903590 is_async : Option < NodeId > ,
35913591 ) -> ( hir:: Generics , hir:: MethodSig ) {
3592- let header = self . lower_fn_header ( sig. header ) ;
3592+ let header = self . lower_fn_header ( & sig. header ) ;
35933593 let ( generics, decl) = self . add_in_band_defs (
35943594 generics,
35953595 fn_def_id,
@@ -3611,10 +3611,10 @@ impl<'a> LoweringContext<'a> {
36113611 }
36123612 }
36133613
3614- fn lower_fn_header ( & mut self , h : FnHeader ) -> hir:: FnHeader {
3614+ fn lower_fn_header ( & mut self , h : & FnHeader ) -> hir:: FnHeader {
36153615 hir:: FnHeader {
36163616 unsafety : self . lower_unsafety ( h. unsafety ) ,
3617- asyncness : self . lower_asyncness ( h. asyncness . node ) ,
3617+ asyncness : self . lower_asyncness ( & h. asyncness . node ) ,
36183618 constness : self . lower_constness ( h. constness ) ,
36193619 abi : h. abi ,
36203620 }
@@ -3634,7 +3634,7 @@ impl<'a> LoweringContext<'a> {
36343634 }
36353635 }
36363636
3637- fn lower_asyncness ( & mut self , a : IsAsync ) -> hir:: IsAsync {
3637+ fn lower_asyncness ( & mut self , a : & IsAsync ) -> hir:: IsAsync {
36383638 match a {
36393639 IsAsync :: Async { .. } => hir:: IsAsync :: Async ,
36403640 IsAsync :: NotAsync => hir:: IsAsync :: NotAsync ,
@@ -3947,7 +3947,7 @@ impl<'a> LoweringContext<'a> {
39473947 } )
39483948 }
39493949 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
39513951 ) => {
39523952 if let IsAsync :: Async { closure_id, .. } = asyncness {
39533953 let outer_decl = FnDecl {
@@ -3985,7 +3985,7 @@ impl<'a> LoweringContext<'a> {
39853985 Some ( & * * ty)
39863986 } else { None } ;
39873987 let async_body = this. make_async_expr (
3988- capture_clause, closure_id, async_ret_ty,
3988+ capture_clause, * closure_id, async_ret_ty,
39893989 |this| {
39903990 this. with_new_scopes ( |this| this. lower_expr ( body) )
39913991 } ) ;
0 commit comments