@@ -188,10 +188,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
188188 let ptr_ty = ptr. ty ;
189189 // Create an *internal* temp for the pointer, so that unsafety
190190 // checking won't complain about the raw pointer assignment.
191- let ptr_temp = this. local_decls . push ( LocalDecl :: with_source_info (
192- ptr_ty,
193- source_info,
194- ) . internal ( ) ) ;
191+ let ptr_temp = this
192+ . local_decls
193+ . push ( LocalDecl :: with_source_info ( ptr_ty, source_info) . internal ( ) ) ;
195194 let ptr_temp = Place :: from ( ptr_temp) ;
196195 let block = unpack ! ( this. into( ptr_temp, block, ptr) ) ;
197196 this. into ( this. hir . tcx ( ) . mk_place_deref ( ptr_temp) , block, val)
@@ -224,7 +223,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
224223 Some ( ( destination, success) )
225224 } ,
226225 from_hir_call,
227- fn_span
226+ fn_span,
228227 } ,
229228 ) ;
230229 success. unit ( )
@@ -387,15 +386,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
387386 // These cases don't actually need a destination
388387 ExprKind :: Assign { .. }
389388 | ExprKind :: AssignOp { .. }
390- | ExprKind :: Continue { .. }
391- | ExprKind :: Break { .. }
392- | ExprKind :: LlvmInlineAsm { .. }
393- | ExprKind :: Return { .. } => {
389+ | ExprKind :: LlvmInlineAsm { .. } => {
394390 unpack ! ( block = this. stmt_expr( block, expr, None ) ) ;
395391 this. cfg . push_assign_unit ( block, source_info, destination, this. hir . tcx ( ) ) ;
396392 block. unit ( )
397393 }
398394
395+ ExprKind :: Continue { .. } | ExprKind :: Break { .. } | ExprKind :: Return { .. } => {
396+ unpack ! ( block = this. stmt_expr( block, expr, None ) ) ;
397+ // No assign, as these have type `!`.
398+ block. unit ( )
399+ }
400+
399401 // Avoid creating a temporary
400402 ExprKind :: VarRef { .. }
401403 | ExprKind :: SelfRef
0 commit comments