Rename the feature, but not the attribute, to `coverage_attribute`

This commit is contained in:
Andy Caldwell 2023-08-24 20:15:41 +01:00
parent de1600d110
commit 679267f2ac
No known key found for this signature in database
GPG Key ID: D4204541AC1D228D
10 changed files with 12 additions and 11 deletions

View File

@ -254,7 +254,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());

View File

@ -400,7 +400,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]`.

View File

@ -395,7 +395,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

View File

@ -574,6 +574,7 @@ symbols! {
cosf64,
count,
coverage,
coverage_attribute,
cr,
crate_id,
crate_in_paths,

View File

@ -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 */
}

View File

@ -111,7 +111,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)]

View File

@ -1,4 +1,4 @@
# `coverage`
# `coverage_attribute`
The tracking issue for this feature is: [#84605]
@ -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() {

View File

@ -1,5 +1,5 @@
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
@ -7,13 +7,13 @@ LL | #![feature(no_coverage)]
= 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

View File

@ -1,5 +1,5 @@
#![feature(extern_types)]
#![feature(coverage)]
#![feature(coverage_attribute)]
#![feature(impl_trait_in_assoc_type)]
#![warn(unused_attributes)]
#![coverage(off)]