Skip to content

Commit 7d87054

Browse files
committedNov 2, 2017
replace Add by tuple
1 parent d9e64eb commit 7d87054

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed
 

‎src/test/mir-opt/match_false_edges.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ fn guard2(_:i32) -> bool {
2020

2121
fn full_tested_match() {
2222
let _ = match Some(42) {
23-
Some(x) if guard() => 1 + x,
24-
Some(y) => 2 + y,
25-
None => 3,
23+
Some(x) if guard() => (1, x),
24+
Some(y) => (2, y),
25+
None => (3, 3),
2626
};
2727
}
2828

2929
fn full_tested_match2() {
3030
let _ = match Some(42) {
31-
Some(x) if guard() => 1 + x,
32-
None => 3,
33-
Some(y) => 2 + y,
31+
Some(x) if guard() => (1, x),
32+
None => (3, 3),
33+
Some(y) => (2, y),
3434
};
3535
}
3636

@@ -55,12 +55,12 @@ fn main() {
5555
// bb1: { // arm1
5656
// StorageLive(_7);
5757
// _7 = _3;
58-
// _1 = Add(const 1i32, _7);
59-
// ...
58+
// _1 = (const 1i32, _7);
59+
// StorageDead(_7);
6060
// goto -> bb11;
6161
// }
6262
// bb2: { // binding3(empty) and arm3
63-
// _1 = const 3i32;
63+
// _1 = (const 3i32, const 3i32);
6464
// goto -> bb11;
6565
// }
6666
// bb3: {
@@ -92,7 +92,7 @@ fn main() {
9292
// _4 = ((_2 as Some).0: i32);
9393
// StorageLive(_8);
9494
// _8 = _4;
95-
// _1 = Add(const 2i32, _8);
95+
// _1 = (const 2i32, _8);
9696
// StorageDead(_8);
9797
// goto -> bb11;
9898
// }
@@ -102,7 +102,7 @@ fn main() {
102102
// }
103103
// END rustc.node17.SimplifyBranches-initial.before.mir
104104
//
105-
// START rustc.node40.SimplifyBranches-initial.before.mir
105+
// START rustc.node42.SimplifyBranches-initial.before.mir
106106
// bb0: {
107107
// ...
108108
// _2 = std::option::Option<i32>::Some(const 42i32,);
@@ -112,12 +112,12 @@ fn main() {
112112
// bb1: { // arm1
113113
// StorageLive(_7);
114114
// _7 = _3;
115-
// _1 = Add(const 1i32, _7);
116-
// ...
115+
// _1 = (const 1i32, _7);
116+
// StorageDead(_7);
117117
// goto -> bb11;
118118
// }
119119
// bb2: { // binding3(empty) and arm3
120-
// _1 = const 3i32;
120+
// _1 = (const 3i32, const 3i32);
121121
// goto -> bb11;
122122
// }
123123
// bb3: {
@@ -149,17 +149,17 @@ fn main() {
149149
// _4 = ((_2 as Some).0: i32);
150150
// StorageLive(_8);
151151
// _8 = _4;
152-
// _1 = Add(const 2i32, _8);
152+
// _1 = (const 2i32, _8);
153153
// StorageDead(_8);
154154
// goto -> bb11;
155155
// }
156156
// bb11: {
157157
// ...
158158
// return;
159159
// }
160-
// END rustc.node40.SimplifyBranches-initial.before.mir
160+
// END rustc.node42.SimplifyBranches-initial.before.mir
161161
//
162-
// START rustc.node63.SimplifyBranches-initial.before.mir
162+
// START rustc.node67.SimplifyBranches-initial.before.mir
163163
// bb0: {
164164
// ...
165165
// _2 = std::option::Option<i32>::Some(const 1i32,);
@@ -233,4 +233,4 @@ fn main() {
233233
// ...
234234
// return;
235235
// }
236-
// END rustc.node63.SimplifyBranches-initial.before.mir
236+
// END rustc.node67.SimplifyBranches-initial.before.mir

0 commit comments

Comments
 (0)
Please sign in to comment.