Rework no_coverage to coverage(off)

This commit is contained in:
Andy Caldwell 2023-08-09 15:57:16 +01:00
parent ce0eeee400
commit 7e786ea4cf
2 changed files with 6 additions and 6 deletions

View file

@ -239,7 +239,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
template!(List: "address, kcfi, memory, thread"), DuplicatesOk,
experimental!(no_sanitize)
),
gated!(no_coverage, Normal, template!(Word), WarnFollowing, experimental!(no_coverage)),
gated!(coverage, Normal, template!(Word, List: "on|off"), WarnFollowing, experimental!(coverage)),
ungated!(
doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk

View file

@ -3505,8 +3505,8 @@ This serves two purposes:
"##,
},
Lint {
label: "no_coverage",
description: r##"# `no_coverage`
label: "coverage",
description: r##"# `coverage`
The tracking issue for this feature is: [#84605]
@ -3514,7 +3514,7 @@ The tracking issue for this feature is: [#84605]
---
The `no_coverage` attribute can be used to selectively disable coverage
The `coverage` attribute can be used to selectively disable coverage
instrumentation in an annotated function. This might be useful to:
- Avoid instrumentation overhead in a performance critical function
@ -3524,14 +3524,14 @@ instrumentation in an annotated function. This might be useful to:
## Example
```rust
#![feature(no_coverage)]
#![feature(coverage)]
// `foo()` will get coverage instrumentation (by default)
fn foo() {
// ...
}
#[no_coverage]
#[coverage(off)]
fn bar() {
// ...
}