Skip to content

Commit

Permalink
Rename the feature, but not the attribute, to coverage_attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
bossmc committed Aug 24, 2023
1 parent 8239f59 commit 0a6c7f0
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/test_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ fn generate_test_harness(
let expn_id = ext_cx.resolver.expansion_for_ast_pass(
DUMMY_SP,
AstPass::TestHarness,
&[sym::test, sym::rustc_attrs, sym::coverage],
&[sym::test, sym::rustc_attrs, sym::coverage_attribute],
None,
);
let def_site = DUMMY_SP.with_def_site_ctxt(expn_id.to_expn_id());
Expand Down
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, "CURRENT_RUSTC_VERSION", Some(84605), None),
(active, coverage_attribute, "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
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
template!(List: "address, kcfi, memory, thread"), DuplicatesOk,
experimental!(no_sanitize)
),
gated!(coverage, Normal, template!(Word, List: "on|off"), WarnFollowing, experimental!(coverage)),
gated!(coverage, Normal, template!(Word, List: "on|off"), WarnFollowing, coverage_attribute, experimental!(coverage)),

ungated!(
doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk
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 @@ -566,6 +566,7 @@ symbols! {
cosf64,
count,
coverage,
coverage_attribute,
cr,
crate_id,
crate_in_paths,
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ pub trait Eq: PartialEq<Self> {
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow_internal_unstable(core_intrinsics, derive_eq, structural_match)]
#[cfg_attr(bootstrap, allow_internal_unstable(no_coverage))]
#[cfg_attr(not(bootstrap), allow_internal_unstable(coverage))]
#[cfg_attr(not(bootstrap), allow_internal_unstable(coverage_attribute))]
pub macro Eq($item:item) {
/* compiler built-in */
}
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
// Library features:
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(no_coverage))] // rust-lang/rust#84605
#![cfg_attr(not(bootstrap), feature(coverage))] // rust-lang/rust#84605
#![cfg_attr(not(bootstrap), feature(coverage_attribute))] // rust-lang/rust#84605
#![feature(char_indices_offset)]
#![feature(const_align_of_val)]
#![feature(const_align_of_val_raw)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `coverage`
# `coverage_attribute`

The tracking issue for this feature is: [#84605]

Expand All @@ -16,7 +16,7 @@ instrumentation in an annotated function. This might be useful to:
## Example

```rust
#![feature(coverage)]
#![feature(coverage_attribute)]

// `foo()` will get coverage instrumentation (by default)
fn foo() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0557]: feature has been removed
--> $DIR/feature-gate-coverage.rs:2:12
--> $DIR/feature-gate-coverage-attribute.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:10:1
--> $DIR/feature-gate-coverage-attribute.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
= help: add `#![feature(coverage_attribute)]` to the crate attributes to enable

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lint/no-coverage.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(extern_types)]
#![feature(coverage)]
#![feature(coverage_attribute)]
#![feature(impl_trait_in_assoc_type)]
#![warn(unused_attributes)]
#![coverage(off)]
Expand Down

0 comments on commit 0a6c7f0

Please sign in to comment.