@@ -157,21 +157,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
157157 hir:: ExprKind :: Path ( qpath)
158158 }
159159 ExprKind :: Break ( opt_label, ref opt_expr) => {
160- let opt_expr =
161- opt_expr. as_ref ( ) . map ( |x| -> & ' hir hir:: Expr < ' hir > { self . lower_expr ( x) } ) ;
160+ let opt_expr = opt_expr. as_ref ( ) . map ( |x| self . lower_expr ( x) ) ;
162161 hir:: ExprKind :: Break ( self . lower_jump_destination ( e. id , opt_label) , opt_expr)
163162 }
164163 ExprKind :: Continue ( opt_label) => {
165164 hir:: ExprKind :: Continue ( self . lower_jump_destination ( e. id , opt_label) )
166165 }
167166 ExprKind :: Ret ( ref e) => {
168- let e = e. as_ref ( ) . map ( |x| -> & ' hir hir :: Expr < ' hir > { self . lower_expr ( x) } ) ;
167+ let e = e. as_ref ( ) . map ( |x| self . lower_expr ( x) ) ;
169168 hir:: ExprKind :: Ret ( e)
170169 }
171170 ExprKind :: InlineAsm ( ref asm) => self . lower_expr_asm ( asm) ,
172171 ExprKind :: Struct ( ref path, ref fields, ref maybe_expr) => {
173- let maybe_expr =
174- maybe_expr. as_ref ( ) . map ( |x| -> & ' hir hir:: Expr < ' hir > { self . lower_expr ( x) } ) ;
172+ let maybe_expr = maybe_expr. as_ref ( ) . map ( |x| self . lower_expr ( x) ) ;
175173 hir:: ExprKind :: Struct (
176174 self . arena . alloc ( self . lower_qpath (
177175 e. id ,
@@ -431,12 +429,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
431429 ) ;
432430
433431 // Final expression of the block (if present) or `()` with span at the end of block
434- let tail_expr = block. expr . take ( ) . map_or_else (
435- || -> & ' hir hir:: Expr < ' hir > {
436- this. expr_unit ( this. sess . source_map ( ) . end_point ( try_span) )
437- } ,
438- |x : & ' hir hir:: Expr < ' hir > | x,
439- ) ;
432+ let tail_expr = block
433+ . expr
434+ . take ( )
435+ . unwrap_or_else ( || this. expr_unit ( this. sess . source_map ( ) . end_point ( try_span) ) ) ;
440436
441437 let ok_wrapped_span =
442438 this. mark_span_with_reason ( DesugaringKind :: TryBlock , tail_expr. span , None ) ;
0 commit comments