1
Fork 0

Correctly mark the ending span of a match arm

Closes #74050

r? @matthewjasper
This commit is contained in:
Ayaz Hafiz 2020-07-07 07:50:49 -07:00
parent 8ac1525e09
commit 3c63fba03d
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
21 changed files with 115 additions and 87 deletions

View file

@ -1790,7 +1790,7 @@ impl<'a> Parser<'a> {
let require_comma = classify::expr_requires_semi_to_be_stmt(&expr) let require_comma = classify::expr_requires_semi_to_be_stmt(&expr)
&& self.token != token::CloseDelim(token::Brace); && self.token != token::CloseDelim(token::Brace);
let hi = self.token.span; let hi = self.prev_token.span;
if require_comma { if require_comma {
let sm = self.sess.source_map(); let sm = self.sess.source_map();

View file

@ -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 _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(_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(_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(_8); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:88: 8:89 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 goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
} }

View file

@ -137,7 +137,7 @@
StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 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 _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 _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 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(_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 StorageLive(_7); // scope 1 at $DIR/issue-73223.rs:7:22: 7:27

View file

@ -137,7 +137,7 @@
StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15 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 _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 _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 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(_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 StorageLive(_7); // scope 1 at $DIR/issue-73223.rs:7:22: 7:27

View file

@ -61,7 +61,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
// mir::Constant // mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:77: 16:78 // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } // + 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: { 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 // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 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(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 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: { 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 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 _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 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: { bb13: {
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
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 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 // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 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(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 goto -> bb11; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
} }
bb17: { 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 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 _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 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: { bb18: {
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
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 goto -> bb3; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
} }
bb19: { bb19: {
StorageDead(_7); // 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:78: 16:79 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:78: 16:79 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:78: 16:79 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 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 // mir::Constant
// + span: $DIR/match-arm-scopes.rs:17:41: 17:42 // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } // + 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: { bb21: {
@ -200,8 +200,8 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
} }
bb22: { bb22: {
StorageDead(_16); // 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:42: 17:43 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 goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
} }

View file

@ -74,7 +74,7 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
// mir::Constant // mir::Constant
// + span: $DIR/match-arm-scopes.rs:16:77: 16:78 // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } // + 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: { 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 // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 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(_9); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 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: { 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, _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(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 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: { bb17: {
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
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 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 // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73 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(_12); // scope 0 at $DIR/match-arm-scopes.rs:16:77: 16:78
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 goto -> bb15; // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
} }
bb22: { 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, _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(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 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: { bb23: {
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
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79 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:78: 16:79 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 falseEdge -> [real: bb5, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
} }
bb24: { bb24: {
StorageDead(_7); // 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:78: 16:79 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:78: 16:79 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:78: 16:79 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 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 // mir::Constant
// + span: $DIR/match-arm-scopes.rs:17:41: 17:42 // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } // + 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: { bb26: {
@ -235,8 +235,8 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
} }
bb27: { bb27: {
StorageDead(_16); // 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:42: 17:43 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 goto -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
} }

View file

@ -97,7 +97,7 @@ fn full_tested_match() -> () {
} }
bb8: { 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(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 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 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 // + span: $DIR/match_false_edges.rs:16:32: 16:33
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37 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(_5); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 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 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
} }
bb9: { bb9: {
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
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38 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 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 // + span: $DIR/match_false_edges.rs:17:21: 17:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26 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 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
} }

View file

@ -62,7 +62,7 @@ fn full_tested_match2() -> () {
// + span: $DIR/match_false_edges.rs:29:21: 29:22 // + span: $DIR/match_false_edges.rs:29:21: 29:22
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26 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 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
} }
@ -89,7 +89,7 @@ fn full_tested_match2() -> () {
} }
bb8: { 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(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 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 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 // + span: $DIR/match_false_edges.rs:27:32: 27:33
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37 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(_5); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 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 goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
} }
bb9: { bb9: {
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
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38 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 falseEdge -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
} }

View file

@ -70,7 +70,7 @@ fn main() -> () {
// mir::Constant // mir::Constant
// + span: $DIR/match_false_edges.rs:39:15: 39:16 // + span: $DIR/match_false_edges.rs:39:15: 39:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) } // + 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 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
} }
@ -97,7 +97,7 @@ fn main() -> () {
} }
bb8: { 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(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 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 StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
@ -109,14 +109,14 @@ fn main() -> () {
// mir::Constant // mir::Constant
// + span: $DIR/match_false_edges.rs:36:32: 36:33 // + span: $DIR/match_false_edges.rs:36:32: 36:33
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_6); // 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:33: 36:34 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 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
} }
bb9: { bb9: {
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
StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34 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 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 // mir::Constant
// + span: $DIR/match_false_edges.rs:37:15: 37:16 // + span: $DIR/match_false_edges.rs:37:15: 37:16
// + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) } // + 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 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
} }
@ -156,7 +156,7 @@ fn main() -> () {
} }
bb13: { 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(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 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 StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
@ -168,14 +168,14 @@ fn main() -> () {
// mir::Constant // mir::Constant
// + span: $DIR/match_false_edges.rs:38:33: 38:34 // + span: $DIR/match_false_edges.rs:38:33: 38:34
// + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) } // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_10); // 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:34: 38:35 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 goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
} }
bb14: { bb14: {
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
StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35 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 falseEdge -> [real: bb4, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
} }

View file

@ -117,7 +117,7 @@ fn main() -> () {
} }
bb10: { 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 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 _3 = const 0_i32; // scope 2 at $DIR/match_test.rs:13:23: 13:24
// ty::Const // ty::Const
@ -130,7 +130,7 @@ fn main() -> () {
} }
bb11: { 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 falseEdge -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
} }

View file

@ -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 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 _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 _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 _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 return; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
} }

View file

@ -53,7 +53,7 @@
} }
bb5: { 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, _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, _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 - FakeRead(ForMatchGuard, _6); // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
@ -73,7 +73,7 @@
} }
bb6: { 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 goto -> bb1; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
} }

View file

@ -61,7 +61,7 @@
((_2 as Foo).0: u8) = move _5; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35 ((_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 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(_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 goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
} }

View file

@ -61,7 +61,7 @@
((_2 as Foo).0: u8) = move _5; // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35 ((_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 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(_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 goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
} }

View file

@ -33,7 +33,7 @@
((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 ((_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 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(_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 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
} }

View file

@ -33,7 +33,7 @@
((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27 ((_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 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(_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 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
} }

View file

@ -29,7 +29,7 @@
((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25 ((_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 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(_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 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 ((_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 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(_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 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
} }

View file

@ -29,7 +29,7 @@
((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25 ((_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 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(_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 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 ((_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 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(_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 goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
} }

View file

@ -115,7 +115,7 @@
bb8: { bb8: {
StorageDead(_5); // scope 1 at $DIR/simplify_try_if_let.rs:31:13: 31:14 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 goto -> bb9; // scope 0 at $DIR/simplify_try_if_let.rs:21:9: 32:10
} }

View file

@ -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,
};
}

View file

@ -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`.