Skip to content

Commit edf8ca2

Browse files
committed
coverage: Force -Copt-level=2 in the unreachable-code test
This test is mainly for detecting problems triggered by MIR optimizations, but the run-coverage tests don't enable optimization by default. (The coverage-map tests do enable optimization by default, but I'm updating the test anyway so that the two `unreachable.rs` files don't drift out of sync.)
1 parent af11465 commit edf8ca2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tests/coverage-map/unreachable.rs

Lines changed: 1 addition & 1 deletion
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+
// compile-flags: --edition=2021 -Copt-level=2
44

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

tests/run-coverage/unreachable.coverage

Lines changed: 1 addition & 1 deletion
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| |// compile-flags: --edition=2021 -Copt-level=2
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/run-coverage/unreachable.rs

Lines changed: 1 addition & 1 deletion
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+
// compile-flags: --edition=2021 -Copt-level=2
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)