4 Preview this file as rendered HTML from the github source at:
5 https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.j-c.-------.InstrumentCoverage.0.html
7 For revisions in Pull Requests (PR):
8 * Replace "rust-lang" with the github PR author
9 * Replace "master" with the PR branch name
14 <title>async.j-c - Coverage Spans
</title>
17 counter-increment: line;
20 content: counter(line)
": ";
21 font-family: Menlo, Monaco, monospace;
24 display: inline-block;
27 -webkit-user-select: none;
31 background-color: #
222222;
32 font-family: Menlo, Monaco, monospace;
34 border-bottom:
2px solid #
222222;
36 display: inline-block;
39 background-color: #
55bbff;
43 background-color: #ee7756;
47 --index: calc(var(--layer) -
1);
48 padding-top: calc(var(--index) *
0.15em);
50 hue-rotate(calc(var(--index) *
25deg))
51 saturate(calc(
100% - (var(--index) *
2%)))
52 brightness(calc(
100% - (var(--index) *
1.5%)));
56 font-family: monospace;
59 -webkit-user-select: none;
61 body:active .annotation {
62 /* requires holding mouse down anywhere on the page */
63 display: inline-block;
65 span:hover .annotation {
66 /* requires hover over a span ONLY on its first line */
67 display: inline-block;
72 <div class=
"code" style=
"counter-reset: line 50"><span class=
"line"> <span><span class=
"code even" style=
"--layer: 1" title=
"52:12-52:13: @0[2]: _3 = _1
73 52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8)"><span class=
"annotation">@
0⦊
</span>fn c(x: u8) -
> u8 {
</span></span>
74 <span class=
"line"><span class=
"code even" style=
"--layer: 1" title=
"52:12-52:13: @0[2]: _3 = _1
75 52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8)"> if x ==
8<span class=
"annotation">⦉@
0</span></span></span><span class=
"code" style=
"--layer: 0"> {
</span></span>
76 <span class=
"line"><span class=
"code" style=
"--layer: 0"> </span><span><span class=
"code odd" style=
"--layer: 1" title=
"53:13-53:14: @1[0]: _0 = const 1_u8"><span class=
"annotation">@
1⦊
</span>1<span class=
"annotation">⦉@
1</span></span></span><span class=
"code" style=
"--layer: 0"> // This line appears covered, but the
1-character expression span covering the `
1`
</span></span>
77 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // is not executed. (`llvm-cov show` displays a `^
0` below the `
1` ). This is because
</span></span>
78 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // `fn j()` executes the open brace for the funciton body, followed by the function's
</span></span>
79 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // first executable statement, `match x`. Inner function declarations are not
</span></span>
80 <span class=
"line"><span class=
"code" style=
"--layer: 0"> //
"visible" to the MIR for `j()`, so the code region counts all lines between the
</span></span>
81 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // open brace and the first statement as executed, which is, in a sense, true.
</span></span>
82 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // `llvm-cov show` overcomes this kind of situation by showing the actual counts
</span></span>
83 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // of the enclosed coverages, (that is, the `
1` expression was not executed, and
</span></span>
84 <span class=
"line"><span class=
"code" style=
"--layer: 0"> // accurately displays a `
0`).
</span></span>
85 <span class=
"line"><span class=
"code" style=
"--layer: 0"> } else {
</span></span>
86 <span class=
"line"><span class=
"code" style=
"--layer: 0"> </span><span><span class=
"code even" style=
"--layer: 1" title=
"63:13-63:14: @2[0]: _0 = const 0_u8"><span class=
"annotation">@
2⦊
</span>0<span class=
"annotation">⦉@
2</span></span></span><span class=
"code" style=
"--layer: 0"></span></span>
87 <span class=
"line"><span class=
"code" style=
"--layer: 0"> }
</span></span>
88 <span class=
"line"><span class=
"code" style=
"--layer: 0"> }
</span><span><span class=
"code odd" style=
"--layer: 1" title=
"65:6-65:6: @3.Return: return"><span class=
"annotation">@
3⦊
</span>‸
<span class=
"annotation">⦉@
3</span></span></span></span></div>