1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
- // MIR for `foo` before ScalarReplacementOfAggregates
+ // MIR for `foo` after ScalarReplacementOfAggregates
fn foo() -> () {
let mut _0: ();
let _1: Foo<T>;
let mut _2: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
let mut _3: std::boxed::Box<dyn std::fmt::Display>;
let mut _4: std::boxed::Box<u32>;
let mut _7: isize;
let _9: ();
let _10: ();
let mut _11: std::fmt::Arguments<'_>;
let mut _13: &std::boxed::Box<dyn std::fmt::Display>;
let mut _14: &u32;
let mut _16: core::fmt::rt::Argument<'_>;
let mut _17: &std::boxed::Box<dyn std::fmt::Display>;
let mut _18: core::fmt::rt::Argument<'_>;
let mut _19: &u32;
let mut _20: &[&str; 3];
let _21: &[&str; 3];
let _22: [&str; 3];
let mut _23: &[core::fmt::rt::Argument<'_>; 2];
let _24: &[core::fmt::rt::Argument<'_>; 2];
let mut _26: &std::boxed::Box<dyn std::fmt::Display>;
let mut _27: &u32;
let mut _28: bool;
let mut _29: isize;
let mut _30: isize;
let mut _31: isize;
+ let _32: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
+ let _33: u32;
scope 1 {
- debug foo => _1;
+ debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _32;
+ debug ((foo: Foo<T>).1: u32) => _33;
let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
scope 2 {
debug x => _5;
let _6: u32;
scope 3 {
debug y => _6;
scope 4 {
debug x => _8;
let _8: std::boxed::Box<dyn std::fmt::Display>;
let _12: (&std::boxed::Box<dyn std::fmt::Display>, &u32);
+ let _34: &std::boxed::Box<dyn std::fmt::Display>;
+ let _35: &u32;
scope 5 {
- debug args => _12;
+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).0: &std::boxed::Box<dyn std::fmt::Display>) => _34;
+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).1: &u32) => _35;
let _15: [core::fmt::rt::Argument<'_>; 2];
scope 6 {
debug args => _15;
let mut _25: &[&str; 3];
}
}
}
}
}
}
bb0: {
_28 = const false;
- StorageLive(_1);
+ StorageLive(_32);
+ StorageLive(_33);
+ nop;
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
_4 = Box::<u32>::new(const 5_u32) -> [return: bb1, unwind unreachable];
}
bb1: {
_3 = move _4 as std::boxed::Box<dyn std::fmt::Display> (PointerCoercion(Unsize, Implicit));
StorageDead(_4);
_2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3);
StorageDead(_3);
- _1 = Foo::<T> { x: move _2, y: const 7_u32 };
+ _32 = move _2;
+ _33 = const 7_u32;
+ nop;
StorageDead(_2);
StorageLive(_5);
_28 = const true;
- _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>);
+ _5 = move _32;
StorageLive(_6);
- _6 = copy (_1.1: u32);
+ _6 = copy _33;
_7 = discriminant(_5);
switchInt(move _7) -> [0: bb2, otherwise: bb7];
}
bb2: {
StorageLive(_8);
_28 = const false;
_8 = move ((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>);
StorageLive(_9);
StorageLive(_10);
StorageLive(_11);
- StorageLive(_12);
+ StorageLive(_34);
+ StorageLive(_35);
+ nop;
StorageLive(_13);
_13 = &_8;
StorageLive(_14);
_14 = &_6;
- _12 = (move _13, move _14);
+ _34 = move _13;
+ _35 = move _14;
+ nop;
StorageDead(_14);
StorageDead(_13);
StorageLive(_15);
StorageLive(_16);
StorageLive(_17);
- _26 = deref_copy (_12.0: &std::boxed::Box<dyn std::fmt::Display>);
+ _26 = deref_copy _34;
_17 = &(*_26);
_16 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _17) -> [return: bb3, unwind unreachable];
}
bb3: {
StorageDead(_17);
StorageLive(_18);
StorageLive(_19);
- _27 = deref_copy (_12.1: &u32);
+ _27 = deref_copy _35;
_19 = &(*_27);
_18 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _19) -> [return: bb4, unwind unreachable];
}
bb4: {
StorageDead(_19);
_15 = [move _16, move _18];
StorageDead(_18);
StorageDead(_16);
StorageLive(_20);
StorageLive(_21);
_25 = const foo::<T>::promoted[0];
_21 = &(*_25);
_20 = &(*_21);
StorageLive(_23);
StorageLive(_24);
_24 = &_15;
_23 = &(*_24);
_11 = core::fmt::rt::<impl Arguments<'_>>::new_v1::<3, 2>(move _20, move _23) -> [return: bb5, unwind unreachable];
}
bb5: {
StorageDead(_24);
StorageDead(_23);
StorageDead(_21);
StorageDead(_20);
_10 = _eprint(move _11) -> [return: bb6, unwind unreachable];
}
bb6: {
StorageDead(_11);
StorageDead(_15);
- StorageDead(_12);
+ StorageDead(_34);
+ StorageDead(_35);
+ nop;
StorageDead(_10);
_9 = const ();
StorageDead(_9);
_0 = const ();
drop(_8) -> [return: bb8, unwind unreachable];
}
bb7: {
_0 = const ();
goto -> bb9;
}
bb8: {
StorageDead(_8);
goto -> bb9;
}
bb9: {
StorageDead(_6);
_29 = discriminant(_5);
switchInt(move _29) -> [0: bb11, otherwise: bb13];
}
bb10: {
_28 = const false;
StorageDead(_5);
- StorageDead(_1);
+ StorageDead(_32);
+ StorageDead(_33);
+ nop;
return;
}
bb11: {
switchInt(copy _28) -> [0: bb10, otherwise: bb12];
}
bb12: {
drop(((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>)) -> [return: bb10, unwind unreachable];
}
bb13: {
drop(_5) -> [return: bb10, unwind unreachable];
}
}
|