@@ -3000,13 +3000,13 @@ impl<'a> LoweringContext<'a> {
30003000 fn lower_async_body (
30013001 & mut self ,
30023002 decl : & FnDecl ,
3003- asyncness : IsAsync ,
3003+ asyncness : & IsAsync ,
30043004 body : & Block ,
30053005 ) -> hir:: BodyId {
30063006 self . lower_body ( Some ( decl) , |this| {
30073007 if let IsAsync :: Async { closure_id, .. } = asyncness {
30083008 let async_expr = this. make_async_expr (
3009- CaptureBy :: Value , closure_id, None ,
3009+ CaptureBy :: Value , * closure_id, None ,
30103010 |this| {
30113011 let body = this. lower_block ( body, false ) ;
30123012 this. expr_block ( body, ThinVec :: new ( ) )
@@ -3067,14 +3067,14 @@ impl<'a> LoweringContext<'a> {
30673067 value
30683068 )
30693069 }
3070- ItemKind :: Fn ( ref decl, header, ref generics, ref body) => {
3070+ ItemKind :: Fn ( ref decl, ref header, ref generics, ref body) => {
30713071 let fn_def_id = self . resolver . definitions ( ) . local_def_id ( id) ;
30723072 self . with_new_scopes ( |this| {
30733073 // Note: we don't need to change the return type from `T` to
30743074 // `impl Future<Output = T>` here because lower_body
30753075 // only cares about the input argument patterns in the function
30763076 // declaration (decl), not the return types.
3077- let body_id = this. lower_async_body ( decl, header. asyncness . node , body) ;
3077+ let body_id = this. lower_async_body ( decl, & header. asyncness . node , body) ;
30783078
30793079 let ( generics, fn_decl) = this. add_in_band_defs (
30803080 generics,
@@ -3565,7 +3565,7 @@ impl<'a> LoweringContext<'a> {
35653565 )
35663566 }
35673567 ImplItemKind :: Method ( ref sig, ref body) => {
3568- let body_id = self . lower_async_body ( & sig. decl , sig. header . asyncness . node , body) ;
3568+ let body_id = self . lower_async_body ( & sig. decl , & sig. header . asyncness . node , body) ;
35693569 let impl_trait_return_allow = !self . is_in_trait_impl ;
35703570 let ( generics, sig) = self . lower_method_sig (
35713571 & i. generics ,
@@ -3767,7 +3767,7 @@ impl<'a> LoweringContext<'a> {
37673767 impl_trait_return_allow : bool ,
37683768 is_async : Option < NodeId > ,
37693769 ) -> ( hir:: Generics , hir:: MethodSig ) {
3770- let header = self . lower_fn_header ( sig. header ) ;
3770+ let header = self . lower_fn_header ( & sig. header ) ;
37713771 let ( generics, decl) = self . add_in_band_defs (
37723772 generics,
37733773 fn_def_id,
@@ -3789,10 +3789,10 @@ impl<'a> LoweringContext<'a> {
37893789 }
37903790 }
37913791
3792- fn lower_fn_header ( & mut self , h : FnHeader ) -> hir:: FnHeader {
3792+ fn lower_fn_header ( & mut self , h : & FnHeader ) -> hir:: FnHeader {
37933793 hir:: FnHeader {
37943794 unsafety : self . lower_unsafety ( h. unsafety ) ,
3795- asyncness : self . lower_asyncness ( h. asyncness . node ) ,
3795+ asyncness : self . lower_asyncness ( & h. asyncness . node ) ,
37963796 constness : self . lower_constness ( h. constness ) ,
37973797 abi : h. abi ,
37983798 }
@@ -3812,7 +3812,7 @@ impl<'a> LoweringContext<'a> {
38123812 }
38133813 }
38143814
3815- fn lower_asyncness ( & mut self , a : IsAsync ) -> hir:: IsAsync {
3815+ fn lower_asyncness ( & mut self , a : & IsAsync ) -> hir:: IsAsync {
38163816 match a {
38173817 IsAsync :: Async { .. } => hir:: IsAsync :: Async ,
38183818 IsAsync :: NotAsync => hir:: IsAsync :: NotAsync ,
@@ -4125,7 +4125,7 @@ impl<'a> LoweringContext<'a> {
41254125 } )
41264126 }
41274127 ExprKind :: Closure (
4128- capture_clause, asyncness, movability, ref decl, ref body, fn_decl_span
4128+ capture_clause, ref asyncness, movability, ref decl, ref body, fn_decl_span
41294129 ) => {
41304130 if let IsAsync :: Async { closure_id, .. } = asyncness {
41314131 let outer_decl = FnDecl {
@@ -4163,7 +4163,7 @@ impl<'a> LoweringContext<'a> {
41634163 Some ( & * * ty)
41644164 } else { None } ;
41654165 let async_body = this. make_async_expr (
4166- capture_clause, closure_id, async_ret_ty,
4166+ capture_clause, * closure_id, async_ret_ty,
41674167 |this| {
41684168 this. with_new_scopes ( |this| this. lower_expr ( body) )
41694169 } ) ;
0 commit comments