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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
<!DOCTYPE html>
<!--
Preview this file as rendered HTML from the github source at:
https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html
For revisions in Pull Requests (PR):
* Replace "rust-lang" with the github PR author
* Replace "master" with the PR branch name
-->
<html>
<head>
<title>generics.main - Coverage Spans</title>
<style>
.line {
counter-increment: line;
}
.line:before {
content: counter(line) ": ";
font-family: Menlo, Monaco, monospace;
font-style: italic;
width: 3.8em;
display: inline-block;
text-align: right;
filter: opacity(50%);
-webkit-user-select: none;
}
.code {
color: #dddddd;
background-color: #222222;
font-family: Menlo, Monaco, monospace;
line-height: 1.4em;
border-bottom: 2px solid #222222;
white-space: pre;
display: inline-block;
}
.odd {
background-color: #55bbff;
color: #223311;
}
.even {
background-color: #ee7756;
color: #551133;
}
.code {
--index: calc(var(--layer) - 1);
padding-top: calc(var(--index) * 0.15em);
filter:
hue-rotate(calc(var(--index) * 25deg))
saturate(calc(100% - (var(--index) * 2%)))
brightness(calc(100% - (var(--index) * 1.5%)));
}
.annotation {
color: #4444ff;
font-family: monospace;
font-style: italic;
display: none;
-webkit-user-select: none;
}
body:active .annotation {
/* requires holding mouse down anywhere on the page */
display: inline-block;
}
span:hover .annotation {
/* requires hover over a span ONLY on its first line */
display: inline-block;
}
</style>
</head>
<body>
<div class="code" style="counter-reset: line 21"><span class="line"><span><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"><span class="annotation">@0,1,2,3⦊</span>fn main() -> Result<(),u8> {</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"> let mut firecracker = Firework { strength: 1 };</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"> firecracker.set_strength(2);</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"></span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"> let mut tnt = Firework { strength: 100.1 };</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"> tnt.set_strength(200.1);</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"> tnt.set_strength(300.3);</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"></span></span>
<span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 }
23:9-23:24: @0[2]: FakeRead(ForLet, _1)
24:5-24:16: @0[5]: _3 = &mut _1
24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15]
26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 }
26:9-26:16: @1[4]: FakeRead(ForLet, _4)
27:5-27:8: @1[7]: _6 = &mut _4
27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14]
28:5-28:8: @2[4]: _8 = &mut _4
28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14]
30:8-30:12: @3[4]: _10 = const true"> if true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> {</span></span>
<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:18-31:41: @4[6]: _27 = const main::promoted[1]
31:18-31:41: @4[7]: _17 = &(*_27)
31:18-31:41: @4[8]: _16 = &(*_17)
31:18-31:41: @4[9]: _15 = move _16 as &[&str] (Pointer(Unsize))
31:9-31:43: @4[15]: _23 = ()
31:9-31:43: @4[16]: FakeRead(ForMatchedPlace, _23)
31:9-31:43: @4[17]: _26 = const main::promoted[0]
31:9-31:43: @4[18]: _21 = &(*_26)
31:9-31:43: @4[19]: _20 = &(*_21)
31:9-31:43: @4[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize))
31:9-31:43: @4.Call: _14 = std::fmt::Arguments::new_v1(move _15, move _19) -> [return: bb6, unwind: bb14]
31:9-31:43: @6.Call: _13 = std::io::_print(move _14) -> [return: bb7, unwind: bb14]
31:9-31:43: @7[5]: _12 = const ()
32:16-32:22: @7[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@4,6,7,11,12⦊</span>println!("Exiting with error...");</span></span>
<span class="line"><span class="code odd" style="--layer: 1" title="31:18-31:41: @4[6]: _27 = const main::promoted[1]
31:18-31:41: @4[7]: _17 = &(*_27)
31:18-31:41: @4[8]: _16 = &(*_17)
31:18-31:41: @4[9]: _15 = move _16 as &[&str] (Pointer(Unsize))
31:9-31:43: @4[15]: _23 = ()
31:9-31:43: @4[16]: FakeRead(ForMatchedPlace, _23)
31:9-31:43: @4[17]: _26 = const main::promoted[0]
31:9-31:43: @4[18]: _21 = &(*_26)
31:9-31:43: @4[19]: _20 = &(*_21)
31:9-31:43: @4[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize))
31:9-31:43: @4.Call: _14 = std::fmt::Arguments::new_v1(move _15, move _19) -> [return: bb6, unwind: bb14]
31:9-31:43: @6.Call: _13 = std::io::_print(move _14) -> [return: bb7, unwind: bb14]
31:9-31:43: @7[5]: _12 = const ()
32:16-32:22: @7[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@4,6,7,11,12</span></span></span><span class="code" style="--layer: 0">;</span></span>
<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"><span class="annotation">@5,8,9,10⦊</span> // The remaining lines below have no coverage because `if true` (with the constant literal</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // `true`) is guaranteed to execute the `then` block, which is also guaranteed to `return`.</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // Thankfully, in the normal case, conditions are not guaranteed ahead of time, and as shown</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // in other tests, the lines below would have coverage (which would show they had `0`</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // executions, assuming the condition still evaluated to `true`).</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> let _ = Firework { strength: 1000 };</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span>
<span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const ()
39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 }
41:8-41:10: @8[2]: _25 = ()
41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> Ok(())<span class="annotation">⦉@5,8,9,10</span></span></span><span class="code" style="--layer: 0"></span></span>
<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="42:2-42:2: @13.Return: return"><span class="annotation">@13⦊</span>‸<span class="annotation">⦉@13</span></span></span></span></div>
</body>
</html>
|