Skip to content

Commit 892b0fd

Browse files
authored
Rollup merge of #120566 - Zalathar:edition, r=compiler-errors
coverage: Use normal `edition:` headers in coverage tests Some of these tests were originally written as part of a custom `run-make` test, so at that time they weren't able to use the normal compiletest header directive parser. Now that they're properly integrated, there's no need for them to use `compile-flags` to specify the edition, since they can use `edition` instead. In most cases the `.cov-map` snapshot isn't affected at all, but in a few cases we add or remove a line, which slightly disturbs the first line number in each instrumented function.
2 parents 977945d + c9c049b commit 892b0fd

18 files changed

+40
-40
lines changed

tests/coverage/bad_counter_ids.cov-map

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
11
Function name: bad_counter_ids::eq_bad
2-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 23, 01, 02, 1f, 00, 03, 01, 00, 02]
2+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 24, 01, 02, 1f, 00, 03, 01, 00, 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 + 35, 1) to (start + 2, 31)
7+
- Code(Counter(0)) at (prev + 36, 1) to (start + 2, 31)
88
- Code(Zero) at (prev + 3, 1) to (start + 0, 2)
99

1010
Function name: bad_counter_ids::eq_bad_message
11-
Raw bytes (21): 0x[01, 01, 01, 01, 00, 03, 01, 28, 01, 02, 0f, 02, 02, 20, 00, 2b, 00, 01, 01, 00, 02]
11+
Raw bytes (21): 0x[01, 01, 01, 01, 00, 03, 01, 29, 01, 02, 0f, 02, 02, 20, 00, 2b, 00, 01, 01, 00, 02]
1212
Number of files: 1
1313
- file 0 => global file 1
1414
Number of expressions: 1
1515
- expression 0 operands: lhs = Counter(0), rhs = Zero
1616
Number of file 0 mappings: 3
17-
- Code(Counter(0)) at (prev + 40, 1) to (start + 2, 15)
17+
- Code(Counter(0)) at (prev + 41, 1) to (start + 2, 15)
1818
- Code(Expression(0, Sub)) at (prev + 2, 32) to (start + 0, 43)
1919
= (c0 - Zero)
2020
- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
2121

2222
Function name: bad_counter_ids::eq_good
23-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 0f, 01, 02, 1f, 05, 03, 01, 00, 02]
23+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 10, 01, 02, 1f, 05, 03, 01, 00, 02]
2424
Number of files: 1
2525
- file 0 => global file 1
2626
Number of expressions: 0
2727
Number of file 0 mappings: 2
28-
- Code(Counter(0)) at (prev + 15, 1) to (start + 2, 31)
28+
- Code(Counter(0)) at (prev + 16, 1) to (start + 2, 31)
2929
- Code(Counter(1)) at (prev + 3, 1) to (start + 0, 2)
3030

3131
Function name: bad_counter_ids::eq_good_message
32-
Raw bytes (19): 0x[01, 01, 00, 03, 01, 14, 01, 02, 0f, 00, 02, 20, 00, 2b, 05, 01, 01, 00, 02]
32+
Raw bytes (19): 0x[01, 01, 00, 03, 01, 15, 01, 02, 0f, 00, 02, 20, 00, 2b, 05, 01, 01, 00, 02]
3333
Number of files: 1
3434
- file 0 => global file 1
3535
Number of expressions: 0
3636
Number of file 0 mappings: 3
37-
- Code(Counter(0)) at (prev + 20, 1) to (start + 2, 15)
37+
- Code(Counter(0)) at (prev + 21, 1) to (start + 2, 15)
3838
- Code(Zero) at (prev + 2, 32) to (start + 0, 43)
3939
- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2)
4040

4141
Function name: bad_counter_ids::ne_bad
42-
Raw bytes (14): 0x[01, 01, 00, 02, 01, 2d, 01, 02, 1f, 00, 03, 01, 00, 02]
42+
Raw bytes (14): 0x[01, 01, 00, 02, 01, 2e, 01, 02, 1f, 00, 03, 01, 00, 02]
4343
Number of files: 1
4444
- file 0 => global file 1
4545
Number of expressions: 0
4646
Number of file 0 mappings: 2
47-
- Code(Counter(0)) at (prev + 45, 1) to (start + 2, 31)
47+
- Code(Counter(0)) at (prev + 46, 1) to (start + 2, 31)
4848
- Code(Zero) at (prev + 3, 1) to (start + 0, 2)
4949

5050
Function name: bad_counter_ids::ne_bad_message
51-
Raw bytes (19): 0x[01, 01, 00, 03, 01, 32, 01, 02, 0f, 05, 02, 20, 00, 2b, 00, 01, 01, 00, 02]
51+
Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 02, 0f, 05, 02, 20, 00, 2b, 00, 01, 01, 00, 02]
5252
Number of files: 1
5353
- file 0 => global file 1
5454
Number of expressions: 0
5555
Number of file 0 mappings: 3
56-
- Code(Counter(0)) at (prev + 50, 1) to (start + 2, 15)
56+
- Code(Counter(0)) at (prev + 51, 1) to (start + 2, 15)
5757
- Code(Counter(1)) at (prev + 2, 32) to (start + 0, 43)
5858
- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
5959

6060
Function name: bad_counter_ids::ne_good
61-
Raw bytes (16): 0x[01, 01, 01, 01, 00, 02, 01, 19, 01, 02, 1f, 02, 03, 01, 00, 02]
61+
Raw bytes (16): 0x[01, 01, 01, 01, 00, 02, 01, 1a, 01, 02, 1f, 02, 03, 01, 00, 02]
6262
Number of files: 1
6363
- file 0 => global file 1
6464
Number of expressions: 1
6565
- expression 0 operands: lhs = Counter(0), rhs = Zero
6666
Number of file 0 mappings: 2
67-
- Code(Counter(0)) at (prev + 25, 1) to (start + 2, 31)
67+
- Code(Counter(0)) at (prev + 26, 1) to (start + 2, 31)
6868
- Code(Expression(0, Sub)) at (prev + 3, 1) to (start + 0, 2)
6969
= (c0 - Zero)
7070

7171
Function name: bad_counter_ids::ne_good_message
72-
Raw bytes (21): 0x[01, 01, 01, 01, 00, 03, 01, 1e, 01, 02, 0f, 00, 02, 20, 00, 2b, 02, 01, 01, 00, 02]
72+
Raw bytes (21): 0x[01, 01, 01, 01, 00, 03, 01, 1f, 01, 02, 0f, 00, 02, 20, 00, 2b, 02, 01, 01, 00, 02]
7373
Number of files: 1
7474
- file 0 => global file 1
7575
Number of expressions: 1
7676
- expression 0 operands: lhs = Counter(0), rhs = Zero
7777
Number of file 0 mappings: 3
78-
- Code(Counter(0)) at (prev + 30, 1) to (start + 2, 15)
78+
- Code(Counter(0)) at (prev + 31, 1) to (start + 2, 15)
7979
- Code(Zero) at (prev + 2, 32) to (start + 0, 43)
8080
- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2)
8181
= (c0 - Zero)

tests/coverage/bad_counter_ids.coverage

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
LL| |#![feature(coverage_attribute)]
2-
LL| |// compile-flags: --edition=2021 -Copt-level=0 -Zmir-opt-level=3
2+
LL| |// edition: 2021
3+
LL| |// compile-flags: -Copt-level=0 -Zmir-opt-level=3
34
LL| |
45
LL| |// Regression test for <https://github.com/rust-lang/rust/issues/117012>.
56
LL| |//

tests/coverage/bad_counter_ids.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(coverage_attribute)]
2-
// compile-flags: --edition=2021 -Copt-level=0 -Zmir-opt-level=3
2+
// edition: 2021
3+
// compile-flags: -Copt-level=0 -Zmir-opt-level=3
34

45
// Regression test for <https://github.com/rust-lang/rust/issues/117012>.
56
//

tests/coverage/closure_macro.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
LL| |// compile-flags: --edition=2018
21
LL| |#![feature(coverage_attribute)]
2+
LL| |// edition: 2018
33
LL| |
44
LL| |macro_rules! bail {
55
LL| | ($msg:literal $(,)?) => {

tests/coverage/closure_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// compile-flags: --edition=2018
21
#![feature(coverage_attribute)]
2+
// edition: 2018
33

44
macro_rules! bail {
55
($msg:literal $(,)?) => {

tests/coverage/fn_sig_into_try.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
LL| |#![feature(coverage_attribute)]
2-
LL| |// compile-flags: --edition=2021
2+
LL| |// edition: 2021
33
LL| |
44
LL| |// Regression test for inconsistent handling of function signature spans that
55
LL| |// are followed by code using the `?` operator.

tests/coverage/fn_sig_into_try.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(coverage_attribute)]
2-
// compile-flags: --edition=2021
2+
// edition: 2021
33

44
// Regression test for inconsistent handling of function signature spans that
55
// are followed by code using the `?` operator.

tests/coverage/issue-93054.cov-map

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
Function name: issue_93054::foo2 (unused)
2-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 16, 01, 00, 1d]
2+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 01, 00, 1d]
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 + 22, 1) to (start + 0, 29)
7+
- Code(Zero) at (prev + 21, 1) to (start + 0, 29)
88

99
Function name: issue_93054::main
10-
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1e, 01, 00, 0d]
10+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1d, 01, 00, 0d]
1111
Number of files: 1
1212
- file 0 => global file 1
1313
Number of expressions: 0
1414
Number of file 0 mappings: 1
15-
- Code(Counter(0)) at (prev + 30, 1) to (start + 0, 13)
15+
- Code(Counter(0)) at (prev + 29, 1) to (start + 0, 13)
1616

1717
Function name: issue_93054::make (unused)
18-
Raw bytes (9): 0x[01, 01, 00, 01, 00, 1a, 01, 02, 02]
18+
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 01, 02, 02]
1919
Number of files: 1
2020
- file 0 => global file 1
2121
Number of expressions: 0
2222
Number of file 0 mappings: 1
23-
- Code(Zero) at (prev + 26, 1) to (start + 2, 2)
23+
- Code(Zero) at (prev + 25, 1) to (start + 2, 2)
2424

tests/coverage/issue-93054.coverage

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
LL| |#![allow(dead_code, unreachable_code)]
2+
LL| |// edition: 2021
23
LL| |
34
LL| |// Regression test for #93054: Functions using uninhabited types often only have a single,
45
LL| |// unreachable basic block which doesn't get instrumented. This should not cause llvm-cov to fail.
56
LL| |// Since these kinds functions can't be invoked anyway, it's ok to not have coverage data for them.
67
LL| |
7-
LL| |// compile-flags: --edition=2021
8-
LL| |
98
LL| |enum Never {}
109
LL| |
1110
LL| |impl Never {

tests/coverage/issue-93054.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#![allow(dead_code, unreachable_code)]
2+
// edition: 2021
23

34
// Regression test for #93054: Functions using uninhabited types often only have a single,
45
// unreachable basic block which doesn't get instrumented. This should not cause llvm-cov to fail.
56
// Since these kinds functions can't be invoked anyway, it's ok to not have coverage data for them.
67

7-
// compile-flags: --edition=2021
8-
98
enum Never {}
109

1110
impl Never {

tests/coverage/long_and_wide.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LL| |// compile-flags: --edition=2021
1+
LL| |// edition: 2021
22
LL| |// ignore-tidy-linelength
33
LL| |
44
LL| |// This file deliberately contains line and column numbers larger than 127,

tests/coverage/long_and_wide.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --edition=2021
1+
// edition: 2021
22
// ignore-tidy-linelength
33

44
// This file deliberately contains line and column numbers larger than 127,

tests/coverage/sort_groups.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LL| |// compile-flags: --edition=2021
1+
LL| |// edition: 2021
22
LL| |
33
LL| |// Demonstrate that `sort_subviews.py` can sort instantiation groups into a
44
LL| |// predictable order, while preserving their heterogeneous contents.

tests/coverage/sort_groups.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --edition=2021
1+
// edition: 2021
22

33
// Demonstrate that `sort_subviews.py` can sort instantiation groups into a
44
// predictable order, while preserving their heterogeneous contents.

tests/coverage/trivial.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LL| |// compile-flags: --edition=2021
1+
LL| |// edition: 2021
22
LL| |
33
LL| 1|fn main() {}
44

tests/coverage/trivial.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// compile-flags: --edition=2021
1+
// edition: 2021
22

33
fn main() {}

tests/coverage/unreachable.coverage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
LL| |#![feature(core_intrinsics)]
22
LL| |#![feature(coverage_attribute)]
3-
LL| |// compile-flags: --edition=2021
3+
LL| |// edition: 2021
44
LL| |
55
LL| |// <https://github.com/rust-lang/rust/issues/116171>
66
LL| |// If we instrument a function for coverage, but all of its counter-increment

tests/coverage/unreachable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(core_intrinsics)]
22
#![feature(coverage_attribute)]
3-
// compile-flags: --edition=2021
3+
// edition: 2021
44

55
// <https://github.com/rust-lang/rust/issues/116171>
66
// If we instrument a function for coverage, but all of its counter-increment

0 commit comments

Comments
 (0)