forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Auto merge of rust-lang#130766 - clarfonthey:stable-coverage-…
- Loading branch information
Showing
128 changed files
with
510 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/doc/unstable-book/src/language-features/coverage-attribute.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() { | ||
// ... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.