Skip to content

Commit d5f3d27

Browse files
committed
Fixed mir-opt test broken because of std::Formatter changes
1 parent 80d35ad commit d5f3d27

2 files changed

+196
-26
lines changed

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

+98-13
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,70 @@
2828
scope 3 {
2929
debug precision => _8;
3030
let _8: usize;
31-
scope 5 (inlined Formatter::<'_>::precision) {
31+
scope 12 (inlined Formatter::<'_>::precision) {
3232
debug self => _1;
33+
let mut _31: &std::fmt::FormattingOptions;
34+
scope 13 (inlined FormattingOptions::get_precision) {
35+
debug self => _31;
36+
}
3337
}
3438
}
3539
}
3640
}
3741
scope 4 (inlined Formatter::<'_>::sign_plus) {
3842
debug self => _1;
39-
let mut _20: u32;
40-
let mut _21: u32;
43+
let mut _20: &std::option::Option<std::fmt::Sign>;
44+
let _21: std::option::Option<std::fmt::Sign>;
45+
let mut _22: &std::fmt::FormattingOptions;
46+
let mut _23: &std::option::Option<std::fmt::Sign>;
47+
scope 5 (inlined FormattingOptions::get_sign) {
48+
debug self => _22;
49+
}
50+
scope 6 (inlined <Option<std::fmt::Sign> as PartialEq>::eq) {
51+
debug self => _20;
52+
debug other => const _;
53+
scope 7 (inlined <std::fmt::Sign as SpecOptionPartialEq>::eq) {
54+
debug l => _20;
55+
debug r => const _;
56+
let mut _24: isize;
57+
let _25: &std::fmt::Sign;
58+
let _26: &std::fmt::Sign;
59+
let mut _27: &std::fmt::Sign;
60+
let mut _28: &std::fmt::Sign;
61+
scope 8 {
62+
debug l => _25;
63+
debug r => _26;
64+
scope 9 (inlined <std::fmt::Sign as PartialEq>::eq) {
65+
debug self => _27;
66+
debug other => _28;
67+
let _29: isize;
68+
scope 10 {
69+
debug __self_tag => _29;
70+
let _30: isize;
71+
scope 11 {
72+
debug __arg1_tag => _30;
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
4179
}
4280

4381
bb0: {
4482
StorageLive(_4);
83+
StorageLive(_23);
4584
StorageLive(_20);
4685
StorageLive(_21);
47-
_21 = ((*_1).0: u32);
48-
_20 = BitAnd(move _21, const 1_u32);
49-
StorageDead(_21);
50-
_4 = Ne(move _20, const 0_u32);
51-
StorageDead(_20);
52-
StorageLive(_5);
53-
switchInt(_4) -> [0: bb2, otherwise: bb1];
86+
StorageLive(_22);
87+
_22 = &((*_1).0: std::fmt::FormattingOptions);
88+
_21 = (((*_1).0: std::fmt::FormattingOptions).0: std::option::Option<std::fmt::Sign>);
89+
_20 = &_21;
90+
StorageDead(_22);
91+
_23 = const _;
92+
StorageLive(_24);
93+
_24 = discriminant(_21);
94+
switchInt(move _24) -> [0: bb10, 1: bb11, otherwise: bb12];
5495
}
5596

5697
bb1: {
@@ -60,14 +101,17 @@
60101
}
61102

62103
bb2: {
63-
- _5 = Minus;
64-
+ _5 = const Minus;
104+
- _5 = core::num::flt2dec::Sign::Minus;
105+
+ _5 = const core::num::flt2dec::Sign::Minus;
65106
goto -> bb3;
66107
}
67108

68109
bb3: {
69110
StorageLive(_6);
70-
_6 = ((*_1).4: std::option::Option<usize>);
111+
StorageLive(_31);
112+
_31 = &((*_1).0: std::fmt::FormattingOptions);
113+
_6 = (((*_1).0: std::fmt::FormattingOptions).6: std::option::Option<usize>);
114+
StorageDead(_31);
71115
_7 = discriminant(_6);
72116
switchInt(move _7) -> [1: bb4, otherwise: bb6];
73117
}
@@ -107,5 +151,46 @@
107151
StorageDead(_6);
108152
return;
109153
}
154+
155+
bb9: {
156+
StorageDead(_24);
157+
StorageDead(_20);
158+
StorageDead(_21);
159+
StorageDead(_23);
160+
StorageLive(_5);
161+
switchInt(_4) -> [0: bb2, otherwise: bb1];
162+
}
163+
164+
bb10: {
165+
_4 = const false;
166+
goto -> bb9;
167+
}
168+
169+
bb11: {
170+
StorageLive(_25);
171+
_25 = &((_21 as Some).0: std::fmt::Sign);
172+
StorageLive(_26);
173+
_26 = &(((*_23) as Some).0: std::fmt::Sign);
174+
StorageLive(_27);
175+
_27 = &((_21 as Some).0: std::fmt::Sign);
176+
StorageLive(_28);
177+
_28 = &(((*_23) as Some).0: std::fmt::Sign);
178+
StorageLive(_29);
179+
StorageLive(_30);
180+
_29 = discriminant(((_21 as Some).0: std::fmt::Sign));
181+
_30 = discriminant((((*_23) as Some).0: std::fmt::Sign));
182+
_4 = Eq(_29, _30);
183+
StorageDead(_30);
184+
StorageDead(_29);
185+
StorageDead(_28);
186+
StorageDead(_27);
187+
StorageDead(_26);
188+
StorageDead(_25);
189+
goto -> bb9;
190+
}
191+
192+
bb12: {
193+
unreachable;
194+
}
110195
}
111196

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

+98-13
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,70 @@
2828
scope 3 {
2929
debug precision => _8;
3030
let _8: usize;
31-
scope 5 (inlined Formatter::<'_>::precision) {
31+
scope 12 (inlined Formatter::<'_>::precision) {
3232
debug self => _1;
33+
let mut _31: &std::fmt::FormattingOptions;
34+
scope 13 (inlined FormattingOptions::get_precision) {
35+
debug self => _31;
36+
}
3337
}
3438
}
3539
}
3640
}
3741
scope 4 (inlined Formatter::<'_>::sign_plus) {
3842
debug self => _1;
39-
let mut _20: u32;
40-
let mut _21: u32;
43+
let mut _20: &std::option::Option<std::fmt::Sign>;
44+
let _21: std::option::Option<std::fmt::Sign>;
45+
let mut _22: &std::fmt::FormattingOptions;
46+
let mut _23: &std::option::Option<std::fmt::Sign>;
47+
scope 5 (inlined FormattingOptions::get_sign) {
48+
debug self => _22;
49+
}
50+
scope 6 (inlined <Option<std::fmt::Sign> as PartialEq>::eq) {
51+
debug self => _20;
52+
debug other => const _;
53+
scope 7 (inlined <std::fmt::Sign as SpecOptionPartialEq>::eq) {
54+
debug l => _20;
55+
debug r => const _;
56+
let mut _24: isize;
57+
let _25: &std::fmt::Sign;
58+
let _26: &std::fmt::Sign;
59+
let mut _27: &std::fmt::Sign;
60+
let mut _28: &std::fmt::Sign;
61+
scope 8 {
62+
debug l => _25;
63+
debug r => _26;
64+
scope 9 (inlined <std::fmt::Sign as PartialEq>::eq) {
65+
debug self => _27;
66+
debug other => _28;
67+
let _29: isize;
68+
scope 10 {
69+
debug __self_tag => _29;
70+
let _30: isize;
71+
scope 11 {
72+
debug __arg1_tag => _30;
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
4179
}
4280

4381
bb0: {
4482
StorageLive(_4);
83+
StorageLive(_23);
4584
StorageLive(_20);
4685
StorageLive(_21);
47-
_21 = ((*_1).0: u32);
48-
_20 = BitAnd(move _21, const 1_u32);
49-
StorageDead(_21);
50-
_4 = Ne(move _20, const 0_u32);
51-
StorageDead(_20);
52-
StorageLive(_5);
53-
switchInt(_4) -> [0: bb2, otherwise: bb1];
86+
StorageLive(_22);
87+
_22 = &((*_1).0: std::fmt::FormattingOptions);
88+
_21 = (((*_1).0: std::fmt::FormattingOptions).0: std::option::Option<std::fmt::Sign>);
89+
_20 = &_21;
90+
StorageDead(_22);
91+
_23 = const _;
92+
StorageLive(_24);
93+
_24 = discriminant(_21);
94+
switchInt(move _24) -> [0: bb10, 1: bb11, otherwise: bb12];
5495
}
5596

5697
bb1: {
@@ -60,14 +101,17 @@
60101
}
61102

62103
bb2: {
63-
- _5 = Minus;
64-
+ _5 = const Minus;
104+
- _5 = core::num::flt2dec::Sign::Minus;
105+
+ _5 = const core::num::flt2dec::Sign::Minus;
65106
goto -> bb3;
66107
}
67108

68109
bb3: {
69110
StorageLive(_6);
70-
_6 = ((*_1).4: std::option::Option<usize>);
111+
StorageLive(_31);
112+
_31 = &((*_1).0: std::fmt::FormattingOptions);
113+
_6 = (((*_1).0: std::fmt::FormattingOptions).6: std::option::Option<usize>);
114+
StorageDead(_31);
71115
_7 = discriminant(_6);
72116
switchInt(move _7) -> [1: bb4, otherwise: bb6];
73117
}
@@ -107,5 +151,46 @@
107151
StorageDead(_6);
108152
return;
109153
}
154+
155+
bb9: {
156+
StorageDead(_24);
157+
StorageDead(_20);
158+
StorageDead(_21);
159+
StorageDead(_23);
160+
StorageLive(_5);
161+
switchInt(_4) -> [0: bb2, otherwise: bb1];
162+
}
163+
164+
bb10: {
165+
_4 = const false;
166+
goto -> bb9;
167+
}
168+
169+
bb11: {
170+
StorageLive(_25);
171+
_25 = &((_21 as Some).0: std::fmt::Sign);
172+
StorageLive(_26);
173+
_26 = &(((*_23) as Some).0: std::fmt::Sign);
174+
StorageLive(_27);
175+
_27 = &((_21 as Some).0: std::fmt::Sign);
176+
StorageLive(_28);
177+
_28 = &(((*_23) as Some).0: std::fmt::Sign);
178+
StorageLive(_29);
179+
StorageLive(_30);
180+
_29 = discriminant(((_21 as Some).0: std::fmt::Sign));
181+
_30 = discriminant((((*_23) as Some).0: std::fmt::Sign));
182+
_4 = Eq(_29, _30);
183+
StorageDead(_30);
184+
StorageDead(_29);
185+
StorageDead(_28);
186+
StorageDead(_27);
187+
StorageDead(_26);
188+
StorageDead(_25);
189+
goto -> bb9;
190+
}
191+
192+
bb12: {
193+
unreachable;
194+
}
110195
}
111196

0 commit comments

Comments
 (0)