Skip to content

Commit 8239f59

Browse files
committed
Add no_coverage to the 'removed features' list
1 parent 9a5ac56 commit 8239f59

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

compiler/rustc_feature/src/active.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ declare_features! (
395395
(active, const_try, "1.56.0", Some(74935), None),
396396
/// Allows function attribute `#[coverage(on/off)]`, to control coverage
397397
/// instrumentation of that function.
398-
(active, coverage, "1.53.0", Some(84605), None),
398+
(active, coverage, "CURRENT_RUSTC_VERSION", Some(84605), None),
399399
/// Allows non-builtin attributes in inner attribute position.
400400
(active, custom_inner_attributes, "1.30.0", Some(54726), None),
401401
/// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`.

compiler/rustc_feature/src/removed.rs

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ declare_features! (
136136
Some("subsumed by `#![feature(allocator_internals)]`")),
137137
/// Allows use of unary negate on unsigned integers, e.g., -e for e: u8
138138
(removed, negate_unsigned, "1.0.0", Some(29645), None, None),
139+
/// Allows `#[no_coverage]` on functions.
140+
/// The feature was renamed to `coverage` and the attribute to `#[coverage(on|off)]`
141+
(removed, no_coverage, "CURRENT_RUSTC_VERSION", Some(84605), None, Some("renamed to `coverage`")),
139142
/// Allows `#[no_debug]`.
140143
(removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
141144
/// Allows using `#[on_unimplemented(..)]` on traits.

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ symbols! {
10281028
no,
10291029
no_builtins,
10301030
no_core,
1031+
no_coverage,
10311032
no_crate_inject,
10321033
no_debug,
10331034
no_default_passes,
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![crate_type = "lib"]
2+
#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]
23

34
#[derive(PartialEq, Eq)] // ensure deriving `Eq` does not enable `feature(coverage)`
45
struct Foo {
@@ -7,7 +8,7 @@ struct Foo {
78
}
89

910
#[coverage(off)] //~ ERROR the `#[coverage]` attribute is an experimental feature
10-
fn requires_feature_no_coverage() -> bool {
11+
fn requires_feature_coverage() -> bool {
1112
let bar = Foo { a: 0, b: 0 };
1213
bar == Foo { a: 0, b: 0 }
1314
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
error[E0557]: feature has been removed
2+
--> $DIR/feature-gate-coverage.rs:2:12
3+
|
4+
LL | #![feature(no_coverage)]
5+
| ^^^^^^^^^^^ feature has been removed
6+
|
7+
= note: renamed to `coverage`
8+
19
error[E0658]: the `#[coverage]` attribute is an experimental feature
2-
--> $DIR/feature-gate-coverage.rs:9:1
10+
--> $DIR/feature-gate-coverage.rs:10:1
311
|
412
LL | #[coverage(off)]
513
| ^^^^^^^^^^^^^^^^
614
|
715
= note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
816
= help: add `#![feature(coverage)]` to the crate attributes to enable
917

10-
error: aborting due to previous error
18+
error: aborting due to 2 previous errors
1119

12-
For more information about this error, try `rustc --explain E0658`.
20+
Some errors have detailed explanations: E0557, E0658.
21+
For more information about an error, try `rustc --explain E0557`.

0 commit comments

Comments
 (0)