Skip to content

Commit 914ab31

Browse files
committed
Fixed mir-opt test broken because of std::Formatter changes
1 parent f17d132 commit 914ab31

File tree

2 files changed

+90
-28
lines changed

2 files changed

+90
-28
lines changed

tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,38 @@
2828
scope 3 {
2929
debug precision => _8;
3030
let _8: usize;
31-
scope 5 (inlined Formatter::<'_>::precision) {
31+
scope 11 (inlined Formatter::<'_>::precision) {
32+
scope 12 (inlined FormattingOptions::get_precision) {
33+
}
3234
}
3335
}
3436
}
3537
}
3638
scope 4 (inlined Formatter::<'_>::sign_plus) {
37-
let mut _20: u32;
38-
let mut _21: u32;
39+
let _20: std::option::Option<std::fmt::Sign>;
40+
scope 5 (inlined FormattingOptions::get_sign) {
41+
}
42+
scope 6 (inlined <Option<std::fmt::Sign> as PartialEq>::eq) {
43+
let mut _21: isize;
44+
scope 7 {
45+
scope 8 (inlined <std::fmt::Sign as PartialEq>::eq) {
46+
let _22: isize;
47+
scope 9 {
48+
scope 10 {
49+
}
50+
}
51+
}
52+
}
53+
}
3954
}
4055

4156
bb0: {
4257
StorageLive(_4);
4358
StorageLive(_20);
59+
_20 = copy (((*_1).0: std::fmt::FormattingOptions).0: std::option::Option<std::fmt::Sign>);
4460
StorageLive(_21);
45-
_21 = copy ((*_1).0: u32);
46-
_20 = BitAnd(move _21, const 1_u32);
47-
StorageDead(_21);
48-
_4 = Ne(move _20, const 0_u32);
49-
StorageDead(_20);
50-
StorageLive(_5);
51-
switchInt(copy _4) -> [0: bb2, otherwise: bb1];
61+
_21 = discriminant(_20);
62+
switchInt(move _21) -> [0: bb11, 1: bb12, otherwise: bb10];
5263
}
5364

5465
bb1: {
@@ -58,16 +69,16 @@
5869
}
5970

6071
bb2: {
61-
- _5 = Minus;
62-
+ _5 = const Minus;
72+
- _5 = core::num::flt2dec::Sign::Minus;
73+
+ _5 = const core::num::flt2dec::Sign::Minus;
6374
goto -> bb3;
6475
}
6576

6677
bb3: {
6778
StorageLive(_6);
68-
_6 = copy ((*_1).4: std::option::Option<usize>);
79+
_6 = copy (((*_1).0: std::fmt::FormattingOptions).6: std::option::Option<usize>);
6980
_7 = discriminant(_6);
70-
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9];
81+
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb10];
7182
}
7283

7384
bb4: {
@@ -135,7 +146,27 @@
135146
}
136147

137148
bb9: {
149+
StorageDead(_21);
150+
StorageDead(_20);
151+
StorageLive(_5);
152+
switchInt(copy _4) -> [0: bb2, otherwise: bb1];
153+
}
154+
155+
bb10: {
138156
unreachable;
139157
}
158+
159+
bb11: {
160+
_4 = const false;
161+
goto -> bb9;
162+
}
163+
164+
bb12: {
165+
StorageLive(_22);
166+
_22 = discriminant(((_20 as Some).0: std::fmt::Sign));
167+
_4 = Eq(copy _22, const 0_isize);
168+
StorageDead(_22);
169+
goto -> bb9;
170+
}
140171
}
141172

tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,38 @@
2828
scope 3 {
2929
debug precision => _8;
3030
let _8: usize;
31-
scope 5 (inlined Formatter::<'_>::precision) {
31+
scope 11 (inlined Formatter::<'_>::precision) {
32+
scope 12 (inlined FormattingOptions::get_precision) {
33+
}
3234
}
3335
}
3436
}
3537
}
3638
scope 4 (inlined Formatter::<'_>::sign_plus) {
37-
let mut _20: u32;
38-
let mut _21: u32;
39+
let _20: std::option::Option<std::fmt::Sign>;
40+
scope 5 (inlined FormattingOptions::get_sign) {
41+
}
42+
scope 6 (inlined <Option<std::fmt::Sign> as PartialEq>::eq) {
43+
let mut _21: isize;
44+
scope 7 {
45+
scope 8 (inlined <std::fmt::Sign as PartialEq>::eq) {
46+
let _22: isize;
47+
scope 9 {
48+
scope 10 {
49+
}
50+
}
51+
}
52+
}
53+
}
3954
}
4055

4156
bb0: {
4257
StorageLive(_4);
4358
StorageLive(_20);
59+
_20 = copy (((*_1).0: std::fmt::FormattingOptions).0: std::option::Option<std::fmt::Sign>);
4460
StorageLive(_21);
45-
_21 = copy ((*_1).0: u32);
46-
_20 = BitAnd(move _21, const 1_u32);
47-
StorageDead(_21);
48-
_4 = Ne(move _20, const 0_u32);
49-
StorageDead(_20);
50-
StorageLive(_5);
51-
switchInt(copy _4) -> [0: bb2, otherwise: bb1];
61+
_21 = discriminant(_20);
62+
switchInt(move _21) -> [0: bb11, 1: bb12, otherwise: bb10];
5263
}
5364

5465
bb1: {
@@ -58,16 +69,16 @@
5869
}
5970

6071
bb2: {
61-
- _5 = Minus;
62-
+ _5 = const Minus;
72+
- _5 = core::num::flt2dec::Sign::Minus;
73+
+ _5 = const core::num::flt2dec::Sign::Minus;
6374
goto -> bb3;
6475
}
6576

6677
bb3: {
6778
StorageLive(_6);
68-
_6 = copy ((*_1).4: std::option::Option<usize>);
79+
_6 = copy (((*_1).0: std::fmt::FormattingOptions).6: std::option::Option<usize>);
6980
_7 = discriminant(_6);
70-
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9];
81+
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb10];
7182
}
7283

7384
bb4: {
@@ -135,7 +146,27 @@
135146
}
136147

137148
bb9: {
149+
StorageDead(_21);
150+
StorageDead(_20);
151+
StorageLive(_5);
152+
switchInt(copy _4) -> [0: bb2, otherwise: bb1];
153+
}
154+
155+
bb10: {
138156
unreachable;
139157
}
158+
159+
bb11: {
160+
_4 = const false;
161+
goto -> bb9;
162+
}
163+
164+
bb12: {
165+
StorageLive(_22);
166+
_22 = discriminant(((_20 as Some).0: std::fmt::Sign));
167+
_4 = Eq(copy _22, const 0_isize);
168+
StorageDead(_22);
169+
goto -> bb9;
170+
}
140171
}
141172

0 commit comments

Comments
 (0)