Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0483413

Browse files
committed
replace usize with u32 to make it easier to bless
1 parent 5cc9395 commit 0483413

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

src/test/mir-opt/early_otherwise_branch.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
// compile-flags: -Z mir-opt-level=3
2-
// EMIT_MIR_FOR_EACH_BIT_WIDTH
32
// EMIT_MIR early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff
4-
fn opt1(x: Option<usize>, y:Option<usize>) -> usize {
5-
match (x,y) {
3+
fn opt1(x: Option<u32>, y: Option<u32>) -> u32 {
4+
match (x, y) {
65
(Some(a), Some(b)) => 0,
7-
_ => 1
6+
_ => 1,
87
}
98
}
109

1110
// EMIT_MIR early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
12-
fn opt2(x: Option<usize>, y:Option<usize>) -> usize {
13-
match (x,y) {
11+
fn opt2(x: Option<u32>, y: Option<u32>) -> u32 {
12+
match (x, y) {
1413
(Some(a), Some(b)) => 0,
1514
(None, None) => 0,
16-
_ => 1
15+
_ => 1,
1716
}
1817
}
1918

src/test/mir-opt/early_otherwise_branch_3_element_tuple.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// compile-flags: -Z mir-opt-level=3
22

3-
// EMIT_MIR_FOR_EACH_BIT_WIDTH
43
// EMIT_MIR early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
5-
fn opt1(x: Option<usize>, y:Option<usize>, z:Option<usize>) -> usize {
6-
match (x,y,z) {
4+
fn opt1(x: Option<u32>, y: Option<u32>, z: Option<u32>) -> u32 {
5+
match (x, y, z) {
76
(Some(a), Some(b), Some(c)) => 0,
8-
_ => 1
7+
_ => 1,
98
}
109
}
1110

src/test/mir-opt/early_otherwise_branch_noopt.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
// must not optimize as it does not follow the pattern of
44
// left and right hand side being the same variant
55

6-
// EMIT_MIR_FOR_EACH_BIT_WIDTH
76
// EMIT_MIR early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
8-
fn noopt1(x: Option<usize>, y:Option<usize>) -> usize {
9-
match (x,y) {
7+
fn noopt1(x: Option<u32>, y: Option<u32>) -> u32 {
8+
match (x, y) {
109
(Some(a), Some(b)) => 0,
1110
(Some(a), None) => 1,
1211
(None, Some(b)) => 2,
13-
(None, None) => 3
12+
(None, None) => 3,
1413
}
1514
}
1615

1716
// must not optimize as the types being matched on are not identical
1817
// EMIT_MIR early_otherwise_branch_noopt.noopt2.EarlyOtherwiseBranch.diff
19-
fn noopt2(x: Option<usize>, y:Option<bool>) -> usize {
20-
match (x,y) {
18+
fn noopt2(x: Option<u32>, y: Option<bool>) -> u32 {
19+
match (x, y) {
2120
(Some(a), Some(b)) => 0,
22-
_ => 1
21+
_ => 1,
2322
}
2423
}
2524

0 commit comments

Comments
 (0)