From 679267f2ac291202e9c8168edd1df8a9cf3aecb2 Mon Sep 17 00:00:00 2001 From: Andy Caldwell Date: Thu, 24 Aug 2023 20:15:41 +0100 Subject: Rename the feature, but not the attribute, to `coverage_attribute` --- .../src/language-features/coverage-attribute.md | 30 ++++++++++++++++++++++ .../src/language-features/coverage.md | 30 ---------------------- 2 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 src/doc/unstable-book/src/language-features/coverage-attribute.md delete mode 100644 src/doc/unstable-book/src/language-features/coverage.md (limited to 'src/doc') diff --git a/src/doc/unstable-book/src/language-features/coverage-attribute.md b/src/doc/unstable-book/src/language-features/coverage-attribute.md new file mode 100644 index 00000000000..0a9bd07de07 --- /dev/null +++ b/src/doc/unstable-book/src/language-features/coverage-attribute.md @@ -0,0 +1,30 @@ +# `coverage_attribute` + +The tracking issue for this feature is: [#84605] + +[#84605]: https://github.com/rust-lang/rust/issues/84605 + +--- + +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 +- Avoid generating coverage for a function that is not meant to be executed, + but still target 100% coverage for the rest of the program. + +## Example + +```rust +#![feature(coverage_attribute)] + +// `foo()` will get coverage instrumentation (by default) +fn foo() { + // ... +} + +#[coverage(off)] +fn bar() { + // ... +} +``` diff --git a/src/doc/unstable-book/src/language-features/coverage.md b/src/doc/unstable-book/src/language-features/coverage.md deleted file mode 100644 index d200bf6b2bc..00000000000 --- a/src/doc/unstable-book/src/language-features/coverage.md +++ /dev/null @@ -1,30 +0,0 @@ -# `coverage` - -The tracking issue for this feature is: [#84605] - -[#84605]: https://github.com/rust-lang/rust/issues/84605 - ---- - -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 -- Avoid generating coverage for a function that is not meant to be executed, - but still target 100% coverage for the rest of the program. - -## Example - -```rust -#![feature(coverage)] - -// `foo()` will get coverage instrumentation (by default) -fn foo() { - // ... -} - -#[coverage(off)] -fn bar() { - // ... -} -``` -- cgit 1.4.1-3-g733a5