Skip to content

Commit

Permalink
Add no_coverage to the 'removed features' list
Browse files Browse the repository at this point in the history
  • Loading branch information
bossmc committed Aug 11, 2023
1 parent 9a5ac56 commit 8239f59
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ declare_features! (
(active, const_try, "1.56.0", Some(74935), None),
/// Allows function attribute `#[coverage(on/off)]`, to control coverage
/// instrumentation of that function.
(active, coverage, "1.53.0", Some(84605), None),
(active, coverage, "CURRENT_RUSTC_VERSION", Some(84605), None),
/// Allows non-builtin attributes in inner attribute position.
(active, custom_inner_attributes, "1.30.0", Some(54726), None),
/// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`.
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ declare_features! (
Some("subsumed by `#![feature(allocator_internals)]`")),
/// Allows use of unary negate on unsigned integers, e.g., -e for e: u8
(removed, negate_unsigned, "1.0.0", Some(29645), None, None),
/// Allows `#[no_coverage]` on functions.
/// The feature was renamed to `coverage` and the attribute to `#[coverage(on|off)]`
(removed, no_coverage, "CURRENT_RUSTC_VERSION", Some(84605), None, Some("renamed to `coverage`")),
/// Allows `#[no_debug]`.
(removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
/// Allows using `#[on_unimplemented(..)]` on traits.
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ symbols! {
no,
no_builtins,
no_core,
no_coverage,
no_crate_inject,
no_debug,
no_default_passes,
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/feature-gates/feature-gate-coverage.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![crate_type = "lib"]
#![feature(no_coverage)] //~ ERROR feature has been removed [E0557]

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

#[coverage(off)] //~ ERROR the `#[coverage]` attribute is an experimental feature
fn requires_feature_no_coverage() -> bool {
fn requires_feature_coverage() -> bool {
let bar = Foo { a: 0, b: 0 };
bar == Foo { a: 0, b: 0 }
}
15 changes: 12 additions & 3 deletions tests/ui/feature-gates/feature-gate-coverage.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
error[E0557]: feature has been removed
--> $DIR/feature-gate-coverage.rs:2:12
|
LL | #![feature(no_coverage)]
| ^^^^^^^^^^^ feature has been removed
|
= note: renamed to `coverage`

error[E0658]: the `#[coverage]` attribute is an experimental feature
--> $DIR/feature-gate-coverage.rs:9:1
--> $DIR/feature-gate-coverage.rs:10:1
|
LL | #[coverage(off)]
| ^^^^^^^^^^^^^^^^
|
= note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
= help: add `#![feature(coverage)]` to the crate attributes to enable

error: aborting due to previous error
error: aborting due to 2 previous errors

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

0 comments on commit 8239f59

Please sign in to comment.