Skip to content

Commit 63cb219

Browse files
authored
Unrolled build for rust-lang#134487
Rollup merge of rust-lang#134487 - ehuss:reference-coverage, r=compiler-errors Add reference annotations for the `coverage` attribute This adds reference annotations for the `coverage` attribute.
2 parents 9e136a3 + dbf5ae3 commit 63cb219

27 files changed

+123
-103
lines changed

tests/coverage/attr/impl.cov-map

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
Function name: <impl::MyStruct>::off_on (unused)
2-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 0d, 05, 00, 13]
2+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 0e, 05, 00, 13]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 1
7-
- Code(Zero) at (prev + 13, 5) to (start + 0, 19)
7+
- Code(Zero) at (prev + 14, 5) to (start + 0, 19)
88
Highest counter ID seen: (none)
99

1010
Function name: <impl::MyStruct>::on_inherit (unused)
11-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 05, 00, 17]
11+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 16, 05, 00, 17]
1212
Number of files: 1
1313
- file 0 => global file 1
1414
Number of expressions: 0
1515
Number of file 0 mappings: 1
16-
- Code(Zero) at (prev + 21, 5) to (start + 0, 23)
16+
- Code(Zero) at (prev + 22, 5) to (start + 0, 23)
1717
Highest counter ID seen: (none)
1818

1919
Function name: <impl::MyStruct>::on_on (unused)
20-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 18, 05, 00, 12]
20+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 05, 00, 12]
2121
Number of files: 1
2222
- file 0 => global file 1
2323
Number of expressions: 0
2424
Number of file 0 mappings: 1
25-
- Code(Zero) at (prev + 24, 5) to (start + 0, 18)
25+
- Code(Zero) at (prev + 25, 5) to (start + 0, 18)
2626
Highest counter ID seen: (none)
2727

tests/coverage/attr/impl.coverage

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
LL| |//@ edition: 2021
2+
LL| |//@ reference: attributes.coverage.nesting
23
LL| |
34
LL| |// Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks,
45
LL| |// and is inherited by any enclosed functions.

tests/coverage/attr/impl.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ edition: 2021
2+
//@ reference: attributes.coverage.nesting
23

34
// Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks,
45
// and is inherited by any enclosed functions.

tests/coverage/attr/module.cov-map

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
Function name: module::off::on (unused)
2-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 0b, 05, 00, 0f]
2+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 0c, 05, 00, 0f]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 1
7-
- Code(Zero) at (prev + 11, 5) to (start + 0, 15)
7+
- Code(Zero) at (prev + 12, 5) to (start + 0, 15)
88
Highest counter ID seen: (none)
99

1010
Function name: module::on::inherit (unused)
11-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 13, 05, 00, 14]
11+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 14, 05, 00, 14]
1212
Number of files: 1
1313
- file 0 => global file 1
1414
Number of expressions: 0
1515
Number of file 0 mappings: 1
16-
- Code(Zero) at (prev + 19, 5) to (start + 0, 20)
16+
- Code(Zero) at (prev + 20, 5) to (start + 0, 20)
1717
Highest counter ID seen: (none)
1818

1919
Function name: module::on::on (unused)
20-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 16, 05, 00, 0f]
20+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 17, 05, 00, 0f]
2121
Number of files: 1
2222
- file 0 => global file 1
2323
Number of expressions: 0
2424
Number of file 0 mappings: 1
25-
- Code(Zero) at (prev + 22, 5) to (start + 0, 15)
25+
- Code(Zero) at (prev + 23, 5) to (start + 0, 15)
2626
Highest counter ID seen: (none)
2727

tests/coverage/attr/module.coverage

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
LL| |//@ edition: 2021
2+
LL| |//@ reference: attributes.coverage.nesting
23
LL| |
34
LL| |// Checks that `#[coverage(..)]` can be applied to modules, and is inherited
45
LL| |// by any enclosed functions.

tests/coverage/attr/module.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ edition: 2021
2+
//@ reference: attributes.coverage.nesting
23

34
// Checks that `#[coverage(..)]` can be applied to modules, and is inherited
45
// by any enclosed functions.

tests/coverage/attr/nested.cov-map

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
Function name: nested::closure_expr
2-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 3f, 01, 01, 0f, 01, 0b, 05, 01, 02]
2+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 40, 01, 01, 0f, 01, 0b, 05, 01, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 2
7-
- Code(Counter(0)) at (prev + 63, 1) to (start + 1, 15)
7+
- Code(Counter(0)) at (prev + 64, 1) to (start + 1, 15)
88
- Code(Counter(0)) at (prev + 11, 5) to (start + 1, 2)
99
Highest counter ID seen: c0
1010

1111
Function name: nested::closure_tail
12-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 4e, 01, 01, 0f, 01, 11, 05, 01, 02]
12+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 4f, 01, 01, 0f, 01, 11, 05, 01, 02]
1313
Number of files: 1
1414
- file 0 => global file 1
1515
Number of expressions: 0
1616
Number of file 0 mappings: 2
17-
- Code(Counter(0)) at (prev + 78, 1) to (start + 1, 15)
17+
- Code(Counter(0)) at (prev + 79, 1) to (start + 1, 15)
1818
- Code(Counter(0)) at (prev + 17, 5) to (start + 1, 2)
1919
Highest counter ID seen: c0
2020

tests/coverage/attr/nested.coverage

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
LL| |#![feature(stmt_expr_attributes)]
22
LL| |//@ edition: 2021
3+
LL| |//@ reference: attributes.coverage.nesting
34
LL| |
45
LL| |// Demonstrates the interaction between #[coverage(off)] and various kinds of
56
LL| |// nested function.

tests/coverage/attr/nested.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(stmt_expr_attributes)]
22
//@ edition: 2021
3+
//@ reference: attributes.coverage.nesting
34

45
// Demonstrates the interaction between #[coverage(off)] and various kinds of
56
// nested function.
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
Function name: off_on_sandwich::dense_a::dense_b
2-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 0e, 05, 02, 12, 01, 07, 05, 00, 06]
2+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 0f, 05, 02, 12, 01, 07, 05, 00, 06]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 2
7-
- Code(Counter(0)) at (prev + 14, 5) to (start + 2, 18)
7+
- Code(Counter(0)) at (prev + 15, 5) to (start + 2, 18)
88
- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 6)
99
Highest counter ID seen: c0
1010

1111
Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c
12-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 20, 09, 02, 17, 01, 0b, 09, 00, 0a]
12+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 21, 09, 02, 17, 01, 0b, 09, 00, 0a]
1313
Number of files: 1
1414
- file 0 => global file 1
1515
Number of expressions: 0
1616
Number of file 0 mappings: 2
17-
- Code(Counter(0)) at (prev + 32, 9) to (start + 2, 23)
17+
- Code(Counter(0)) at (prev + 33, 9) to (start + 2, 23)
1818
- Code(Counter(0)) at (prev + 11, 9) to (start + 0, 10)
1919
Highest counter ID seen: c0
2020

2121
Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c::sparse_d
22-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 23, 0d, 02, 1b, 01, 07, 0d, 00, 0e]
22+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 24, 0d, 02, 1b, 01, 07, 0d, 00, 0e]
2323
Number of files: 1
2424
- file 0 => global file 1
2525
Number of expressions: 0
2626
Number of file 0 mappings: 2
27-
- Code(Counter(0)) at (prev + 35, 13) to (start + 2, 27)
27+
- Code(Counter(0)) at (prev + 36, 13) to (start + 2, 27)
2828
- Code(Counter(0)) at (prev + 7, 13) to (start + 0, 14)
2929
Highest counter ID seen: c0
3030

tests/coverage/attr/off-on-sandwich.coverage

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
LL| |//@ edition: 2021
2+
LL| |//@ reference: attributes.coverage.nesting
23
LL| |
34
LL| |// Demonstrates the interaction of `#[coverage(off)]` and `#[coverage(on)]`
45
LL| |// in nested functions.

tests/coverage/attr/off-on-sandwich.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ edition: 2021
2+
//@ reference: attributes.coverage.nesting
23

34
// Demonstrates the interaction of `#[coverage(off)]` and `#[coverage(on)]`
45
// in nested functions.

tests/coverage/no_cov_crate.cov-map

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
Function name: no_cov_crate::add_coverage_1
2-
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 01, 02, 02]
2+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 02, 02]
33
Number of files: 1
44
- file 0 => global file 1
55
Number of expressions: 0
66
Number of file 0 mappings: 1
7-
- Code(Counter(0)) at (prev + 19, 1) to (start + 2, 2)
7+
- Code(Counter(0)) at (prev + 21, 1) to (start + 2, 2)
88
Highest counter ID seen: c0
99

1010
Function name: no_cov_crate::add_coverage_2
11-
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 02, 02]
11+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 19, 01, 02, 02]
1212
Number of files: 1
1313
- file 0 => global file 1
1414
Number of expressions: 0
1515
Number of file 0 mappings: 1
16-
- Code(Counter(0)) at (prev + 23, 1) to (start + 2, 2)
16+
- Code(Counter(0)) at (prev + 25, 1) to (start + 2, 2)
1717
Highest counter ID seen: c0
1818

1919
Function name: no_cov_crate::add_coverage_not_called (unused)
20-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 1c, 01, 02, 02]
20+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 1e, 01, 02, 02]
2121
Number of files: 1
2222
- file 0 => global file 1
2323
Number of expressions: 0
2424
Number of file 0 mappings: 1
25-
- Code(Zero) at (prev + 28, 1) to (start + 2, 2)
25+
- Code(Zero) at (prev + 30, 1) to (start + 2, 2)
2626
Highest counter ID seen: (none)
2727

2828
Function name: no_cov_crate::main
29-
Raw bytes (9): 0x[01, 01, 00, 01, 01, 4c, 01, 0b, 02]
29+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 4e, 01, 0b, 02]
3030
Number of files: 1
3131
- file 0 => global file 1
3232
Number of expressions: 0
3333
Number of file 0 mappings: 1
34-
- Code(Counter(0)) at (prev + 76, 1) to (start + 11, 2)
34+
- Code(Counter(0)) at (prev + 78, 1) to (start + 11, 2)
3535
Highest counter ID seen: c0
3636

3737
Function name: no_cov_crate::nested_fns::outer
38-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 30, 05, 02, 23, 01, 0c, 05, 00, 06]
38+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 32, 05, 02, 23, 01, 0c, 05, 00, 06]
3939
Number of files: 1
4040
- file 0 => global file 1
4141
Number of expressions: 0
4242
Number of file 0 mappings: 2
43-
- Code(Counter(0)) at (prev + 48, 5) to (start + 2, 35)
43+
- Code(Counter(0)) at (prev + 50, 5) to (start + 2, 35)
4444
- Code(Counter(0)) at (prev + 12, 5) to (start + 0, 6)
4545
Highest counter ID seen: c0
4646

4747
Function name: no_cov_crate::nested_fns::outer_both_covered
48-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 3e, 05, 02, 17, 01, 0b, 05, 00, 06]
48+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 40, 05, 02, 17, 01, 0b, 05, 00, 06]
4949
Number of files: 1
5050
- file 0 => global file 1
5151
Number of expressions: 0
5252
Number of file 0 mappings: 2
53-
- Code(Counter(0)) at (prev + 62, 5) to (start + 2, 23)
53+
- Code(Counter(0)) at (prev + 64, 5) to (start + 2, 23)
5454
- Code(Counter(0)) at (prev + 11, 5) to (start + 0, 6)
5555
Highest counter ID seen: c0
5656

5757
Function name: no_cov_crate::nested_fns::outer_both_covered::inner
58-
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 42, 09, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a]
58+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 44, 09, 01, 17, 05, 01, 18, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a]
5959
Number of files: 1
6060
- file 0 => global file 1
6161
Number of expressions: 1
6262
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
6363
Number of file 0 mappings: 4
64-
- Code(Counter(0)) at (prev + 66, 9) to (start + 1, 23)
64+
- Code(Counter(0)) at (prev + 68, 9) to (start + 1, 23)
6565
- Code(Counter(1)) at (prev + 1, 24) to (start + 2, 14)
6666
- Code(Expression(0, Sub)) at (prev + 2, 20) to (start + 2, 14)
6767
= (c0 - c1)

tests/coverage/no_cov_crate.coverage

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
LL| |// Enables `coverage(off)` on the entire crate
2+
LL| |//@ reference: attributes.coverage.intro
3+
LL| |//@ reference: attributes.coverage.nesting
24
LL| |
35
LL| |#[coverage(off)]
46
LL| |fn do_not_add_coverage_1() {

tests/coverage/no_cov_crate.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Enables `coverage(off)` on the entire crate
2+
//@ reference: attributes.coverage.intro
3+
//@ reference: attributes.coverage.nesting
24

35
#[coverage(off)]
46
fn do_not_add_coverage_1() {

tests/ui/coverage-attr/bad-attr-ice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ compile-flags: -Cinstrument-coverage
22
//@ needs-profiler-runtime
3+
//@ reference: attributes.coverage.syntax
34

45
// Malformed `#[coverage(..)]` attributes should not cause an ICE when built
56
// with `-Cinstrument-coverage`.

tests/ui/coverage-attr/bad-attr-ice.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: malformed `coverage` attribute input
2-
--> $DIR/bad-attr-ice.rs:8:1
2+
--> $DIR/bad-attr-ice.rs:9:1
33
|
44
LL | #[coverage]
55
| ^^^^^^^^^^^

tests/ui/coverage-attr/bad-syntax.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//@ edition: 2021
2+
//@ reference: attributes.coverage.syntax
3+
//@ reference: attributes.coverage.duplicates
24

35
// Tests the error messages produced (or not produced) by various unusual
46
// uses of the `#[coverage(..)]` attribute.

0 commit comments

Comments
 (0)