From 3c63fba03daedf014b75e12f32f4daec3598f9a3 Mon Sep 17 00:00:00 2001
From: Ayaz Hafiz <ayaz.hafiz.1@gmail.com>
Date: Tue, 7 Jul 2020 07:50:49 -0700
Subject: [PATCH] Correctly mark the ending span of a match arm

Closes #74050

r? @matthewjasper
---
 src/librustc_parse/parser/expr.rs             |  2 +-
 ....match_tuple.SimplifyCfg-initial.after.mir |  4 +-
 .../32bit/rustc.main.SimplifyArmIdentity.diff |  2 +-
 .../64bit/rustc.main.SimplifyArmIdentity.diff |  2 +-
 ...complicated_match.ElaborateDrops.after.mir | 44 +++++++++----------
 ...icated_match.SimplifyCfg-initial.after.mir | 44 +++++++++----------
 ...c.full_tested_match.PromoteTemps.after.mir | 12 ++---
 ...full_tested_match2.PromoteTemps.before.mir | 12 ++---
 .../rustc.main.PromoteTemps.before.mir        | 24 +++++-----
 .../rustc.main.SimplifyCfg-initial.after.mir  |  4 +-
 ...wrap.SimplifyCfg-elaborate-drops.after.mir |  2 +-
 ...tch_guard.CleanupNonCodegenStatements.diff |  4 +-
 .../32bit/rustc.main.SimplifyArmIdentity.diff |  2 +-
 .../64bit/rustc.main.SimplifyArmIdentity.diff |  2 +-
 .../rustc.id.SimplifyArmIdentity.diff         |  2 +-
 .../rustc.id.SimplifyBranchSame.diff          |  2 +-
 .../rustc.id_result.SimplifyArmIdentity.diff  |  4 +-
 .../rustc.id_result.SimplifyBranchSame.diff   |  4 +-
 ...c.{{impl}}-append.SimplifyArmIdentity.diff |  2 +-
 src/test/ui/match/issue-74050-end-span.rs     | 13 ++++++
 src/test/ui/match/issue-74050-end-span.stderr | 15 +++++++
 21 files changed, 115 insertions(+), 87 deletions(-)
 create mode 100644 src/test/ui/match/issue-74050-end-span.rs
 create mode 100644 src/test/ui/match/issue-74050-end-span.stderr

diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs
index abb44493353..876ce3ab2cb 100644
--- a/src/librustc_parse/parser/expr.rs
+++ b/src/librustc_parse/parser/expr.rs
@@ -1790,7 +1790,7 @@ impl<'a> Parser<'a> {
         let require_comma = classify::expr_requires_semi_to_be_stmt(&expr)
             && self.token != token::CloseDelim(token::Brace);
 
-        let hi = self.token.span;
+        let hi = self.prev_token.span;
 
         if require_comma {
             let sm = self.sess.source_map();
diff --git a/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir b/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir
index b84ca5df996..00942cd12b4 100644
--- a/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir
+++ b/src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir
@@ -102,8 +102,8 @@ fn match_tuple(_1: (u32, bool, std::option::Option<i32>, u32)) -> u32 {
         _0 = BitXor(move _9, move _10);  // scope 1 at $DIR/exponential-or.rs:8:83: 8:88
         StorageDead(_10);                // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
         StorageDead(_9);                 // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
-        StorageDead(_8);                 // scope 0 at $DIR/exponential-or.rs:8:88: 8:89
-        StorageDead(_7);                 // scope 0 at $DIR/exponential-or.rs:8:88: 8:89
+        StorageDead(_8);                 // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
+        StorageDead(_7);                 // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
         goto -> bb10;                    // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
     }
 
diff --git a/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff
index e5b4a032880..1020fc965fe 100644
--- a/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff
@@ -137,7 +137,7 @@
           StorageLive(_4);                 // scope 0 at $DIR/issue-73223.rs:3:14: 3:15
           _4 = ((_2 as Some).0: i32);      // scope 0 at $DIR/issue-73223.rs:3:14: 3:15
           _1 = _4;                         // scope 2 at $DIR/issue-73223.rs:3:20: 3:21
-          StorageDead(_4);                 // scope 0 at $DIR/issue-73223.rs:3:21: 3:22
+          StorageDead(_4);                 // scope 0 at $DIR/issue-73223.rs:3:20: 3:21
           StorageDead(_2);                 // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
           StorageLive(_6);                 // scope 1 at $DIR/issue-73223.rs:7:9: 7:14
           StorageLive(_7);                 // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
diff --git a/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff
index 0c2651dc3c6..aa606ed22b6 100644
--- a/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff
@@ -137,7 +137,7 @@
           StorageLive(_4);                 // scope 0 at $DIR/issue-73223.rs:3:14: 3:15
           _4 = ((_2 as Some).0: i32);      // scope 0 at $DIR/issue-73223.rs:3:14: 3:15
           _1 = _4;                         // scope 2 at $DIR/issue-73223.rs:3:20: 3:21
-          StorageDead(_4);                 // scope 0 at $DIR/issue-73223.rs:3:21: 3:22
+          StorageDead(_4);                 // scope 0 at $DIR/issue-73223.rs:3:20: 3:21
           StorageDead(_2);                 // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
           StorageLive(_6);                 // scope 1 at $DIR/issue-73223.rs:7:9: 7:14
           StorageLive(_7);                 // scope 1 at $DIR/issue-73223.rs:7:22: 7:27
diff --git a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir
index c6832f21208..df6a247bb5f 100644
--- a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir
+++ b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir
@@ -61,7 +61,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
     }
 
     bb6: {
@@ -90,9 +90,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
         StorageDead(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb11;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
@@ -109,7 +109,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb12: {
-        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         StorageLive(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
         _5 = (_2.1: bool);               // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
         StorageLive(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
@@ -118,9 +118,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb13: {
-        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb2;                     // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
@@ -150,14 +150,14 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
         StorageDead(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb11;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
     bb17: {
-        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         StorageLive(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
         _5 = (_2.0: bool);               // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
         StorageLive(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
@@ -166,17 +166,17 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb18: {
-        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb3;                     // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb19: {
-        StorageDead(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb23;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
@@ -188,7 +188,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42
     }
 
     bb21: {
@@ -200,8 +200,8 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb22: {
-        StorageDead(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
-        StorageDead(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        StorageDead(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42
+        StorageDead(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42
         goto -> bb23;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
diff --git a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir
index 45f7e91d097..dadbc3668cb 100644
--- a/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir
+++ b/src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir
@@ -74,7 +74,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
     }
 
     bb9: {
@@ -110,9 +110,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
         StorageDead(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb15;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
@@ -129,7 +129,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb16: {
-        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         FakeRead(ForMatchGuard, _3);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
         FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
@@ -142,9 +142,9 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb17: {
-        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         falseEdge -> [real: bb3, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
@@ -181,14 +181,14 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
         StorageDead(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb15;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
     bb22: {
-        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         FakeRead(ForMatchGuard, _3);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
         FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
@@ -201,17 +201,17 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb23: {
-        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         falseEdge -> [real: bb5, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb24: {
-        StorageDead(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
         goto -> bb28;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
@@ -223,7 +223,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42
     }
 
     bb26: {
@@ -235,8 +235,8 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb27: {
-        StorageDead(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
-        StorageDead(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        StorageDead(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42
+        StorageDead(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:41: 17:42
         goto -> bb28;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
index d4a2afe2957..5ff4150d2ac 100644
--- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
@@ -97,7 +97,7 @@ fn full_tested_match() -> () {
     }
 
     bb8: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
         FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
         StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
@@ -112,14 +112,14 @@ fn full_tested_match() -> () {
                                          // + span: $DIR/match_false_edges.rs:16:32: 16:33
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
         StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
-        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
     }
 
     bb9: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
         goto -> bb4;                     // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
     }
 
@@ -136,7 +136,7 @@ fn full_tested_match() -> () {
                                          // + span: $DIR/match_false_edges.rs:17:21: 17:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
         StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
-        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:17:26: 17:27
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26
         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
     }
 
diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
index f1744a94fdc..b79416fe31a 100644
--- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
@@ -62,7 +62,7 @@ fn full_tested_match2() -> () {
                                          // + span: $DIR/match_false_edges.rs:29:21: 29:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
         StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
-        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:26: 29:27
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26
         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
     }
 
@@ -89,7 +89,7 @@ fn full_tested_match2() -> () {
     }
 
     bb8: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
         FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
         StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
@@ -104,14 +104,14 @@ fn full_tested_match2() -> () {
                                          // + span: $DIR/match_false_edges.rs:27:32: 27:33
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
         StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
-        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
     }
 
     bb9: {
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
         falseEdge -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
     }
 
diff --git a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
index 4ab4c4d341e..5b449da93d4 100644
--- a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
@@ -70,7 +70,7 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:39:15: 39:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-        StorageDead(_14);                // scope 0 at $DIR/match_false_edges.rs:39:16: 39:17
+        StorageDead(_14);                // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16
         goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
@@ -97,7 +97,7 @@ fn main() -> () {
     }
 
     bb8: {
-        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
         FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
         FakeRead(ForGuardBinding, _7);   // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
         StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
@@ -109,14 +109,14 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:36:32: 36:33
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
         goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
     bb9: {
-        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
         falseEdge -> [real: bb2, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
     }
 
@@ -130,7 +130,7 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:37:15: 37:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:37:16: 37:17
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16
         goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
@@ -156,7 +156,7 @@ fn main() -> () {
     }
 
     bb13: {
-        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
         FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
         FakeRead(ForGuardBinding, _11);  // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
         StorageLive(_10);                // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
@@ -168,14 +168,14 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:38:33: 38:34
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageDead(_10);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        StorageDead(_10);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
+        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
         goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
     bb14: {
-        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
+        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
         falseEdge -> [real: bb4, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
     }
 
diff --git a/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir
index ef6c88d8005..16895942cb8 100644
--- a/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir
+++ b/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir
@@ -117,7 +117,7 @@ fn main() -> () {
     }
 
     bb10: {
-        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:24: 13:25
+        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:23: 13:24
         FakeRead(ForMatchGuard, _8);     // scope 2 at $DIR/match_test.rs:13:18: 13:19
         _3 = const 0_i32;                // scope 2 at $DIR/match_test.rs:13:23: 13:24
                                          // ty::Const
@@ -130,7 +130,7 @@ fn main() -> () {
     }
 
     bb11: {
-        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:24: 13:25
+        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:23: 13:24
         falseEdge -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
     }
 
diff --git a/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir
index 2e8cfaea937..f3f2b68e53d 100644
--- a/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir
@@ -43,7 +43,7 @@ fn unwrap(_1: std::option::Option<T>) -> T {
         StorageLive(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
         _3 = move ((_1 as Some).0: T);   // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
         _0 = move _3;                    // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
-        StorageDead(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22
+        StorageDead(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
         _6 = discriminant(_1);           // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
         return;                          // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
     }
diff --git a/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff b/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff
index 7fc20977870..0822d8cc03c 100644
--- a/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff
+++ b/src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff
@@ -53,7 +53,7 @@
       }
   
       bb5: {
-          StorageDead(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
+          StorageDead(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
 -         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
 -         FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
 -         FakeRead(ForMatchGuard, _6);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
@@ -73,7 +73,7 @@
       }
   
       bb6: {
-          StorageDead(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
+          StorageDead(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
           goto -> bb1;                     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
       }
   
diff --git a/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff
index 33a3403cada..0de80f72a1e 100644
--- a/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff
@@ -61,7 +61,7 @@
           ((_2 as Foo).0: u8) = move _5;   // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
           discriminant(_2) = 0;            // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
           StorageDead(_5);                 // scope 3 at $DIR/simplify-arm-identity.rs:20:34: 20:35
-          StorageDead(_4);                 // scope 1 at $DIR/simplify-arm-identity.rs:20:35: 20:36
+          StorageDead(_4);                 // scope 1 at $DIR/simplify-arm-identity.rs:20:34: 20:35
           goto -> bb4;                     // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
       }
   
diff --git a/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff
index 7e4fe1c2dcc..4fa0aff8fa0 100644
--- a/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff
@@ -61,7 +61,7 @@
           ((_2 as Foo).0: u8) = move _5;   // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
           discriminant(_2) = 0;            // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
           StorageDead(_5);                 // scope 3 at $DIR/simplify-arm-identity.rs:20:34: 20:35
-          StorageDead(_4);                 // scope 1 at $DIR/simplify-arm-identity.rs:20:35: 20:36
+          StorageDead(_4);                 // scope 1 at $DIR/simplify-arm-identity.rs:20:34: 20:35
           goto -> bb4;                     // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
       }
   
diff --git a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff
index daae94e87f0..0cddcb061cf 100644
--- a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyArmIdentity.diff
@@ -33,7 +33,7 @@
           ((_0 as Some).0: u8) = move _4;  // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
           discriminant(_0) = 1;            // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
           StorageDead(_4);                 // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27
-          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:11:27: 11:28
+          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27
           goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
       }
   
diff --git a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff
index 15bd5e7c9f0..cd5962c682a 100644
--- a/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff
+++ b/src/test/mir-opt/simplify-arm/rustc.id.SimplifyBranchSame.diff
@@ -33,7 +33,7 @@
           ((_0 as Some).0: u8) = move _4;  // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
           discriminant(_0) = 1;            // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
           StorageDead(_4);                 // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27
-          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:11:27: 11:28
+          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27
           goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
       }
   
diff --git a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff
index 37273d1d651..642ccc1ab14 100644
--- a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyArmIdentity.diff
@@ -29,7 +29,7 @@
           ((_0 as Err).0: i32) = move _6;  // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
           discriminant(_0) = 1;            // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
           StorageDead(_6);                 // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25
-          StorageDead(_5);                 // scope 0 at $DIR/simplify-arm.rs:19:25: 19:26
+          StorageDead(_5);                 // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25
           goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
       }
   
@@ -45,7 +45,7 @@
           ((_0 as Ok).0: u8) = move _4;    // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
           discriminant(_0) = 0;            // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
           StorageDead(_4);                 // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23
-          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:18:23: 18:24
+          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23
           goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
       }
   
diff --git a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff
index f138d637435..95ce09a39ed 100644
--- a/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff
+++ b/src/test/mir-opt/simplify-arm/rustc.id_result.SimplifyBranchSame.diff
@@ -29,7 +29,7 @@
           ((_0 as Err).0: i32) = move _6;  // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
           discriminant(_0) = 1;            // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
           StorageDead(_6);                 // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25
-          StorageDead(_5);                 // scope 0 at $DIR/simplify-arm.rs:19:25: 19:26
+          StorageDead(_5);                 // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25
           goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
       }
   
@@ -45,7 +45,7 @@
           ((_0 as Ok).0: u8) = move _4;    // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
           discriminant(_0) = 0;            // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
           StorageDead(_4);                 // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23
-          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:18:23: 18:24
+          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23
           goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
       }
   
diff --git a/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff
index aa416049f66..4471f4d206c 100644
--- a/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify_try_if_let/rustc.{{impl}}-append.SimplifyArmIdentity.diff
@@ -115,7 +115,7 @@
   
       bb8: {
           StorageDead(_5);                 // scope 1 at $DIR/simplify_try_if_let.rs:31:13: 31:14
-          StorageDead(_4);                 // scope 0 at $DIR/simplify_try_if_let.rs:32:9: 32:10
+          StorageDead(_4);                 // scope 0 at $DIR/simplify_try_if_let.rs:31:13: 31:14
           goto -> bb9;                     // scope 0 at $DIR/simplify_try_if_let.rs:21:9: 32:10
       }
   
diff --git a/src/test/ui/match/issue-74050-end-span.rs b/src/test/ui/match/issue-74050-end-span.rs
new file mode 100644
index 00000000000..cc81214e270
--- /dev/null
+++ b/src/test/ui/match/issue-74050-end-span.rs
@@ -0,0 +1,13 @@
+fn main() {
+    let mut args = std::env::args_os();
+    let _arg = match args.next() {
+        Some(arg) => {
+            match arg.to_str() {
+                //~^ ERROR `arg` does not live long enough
+                Some(s) => s,
+                None => return,
+            }
+        }
+        None => return,
+    };
+}
diff --git a/src/test/ui/match/issue-74050-end-span.stderr b/src/test/ui/match/issue-74050-end-span.stderr
new file mode 100644
index 00000000000..d636a11a91c
--- /dev/null
+++ b/src/test/ui/match/issue-74050-end-span.stderr
@@ -0,0 +1,15 @@
+error[E0597]: `arg` does not live long enough
+  --> $DIR/issue-74050-end-span.rs:5:19
+   |
+LL |     let _arg = match args.next() {
+   |         ---- borrow later stored here
+LL |         Some(arg) => {
+LL |             match arg.to_str() {
+   |                   ^^^ borrowed value does not live long enough
+...
+LL |         }
+   |         - `arg` dropped here while still borrowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.