Skip to content

Commit f71cbc6

Browse files
committed
Add rule annotations
1 parent 081372c commit f71cbc6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/attributes/coverage-instrumentation.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ The following [attributes] are used for controlling coverage instrumentation, wh
44

55
### The `coverage` attribute
66

7-
The *`coverage` [attribute]* indicates whether a function should instrument code coverage at all and show up in code coverage reports. It can only be controlled at the function level, but it can be applied to modules, `impl` blocks, or anything that can contain functions.
7+
r[attributes.coverage]
88

9+
r[attributes.coverage.intro]
10+
The *`coverage` [attribute]* indicates whether a function should instrument code coverage at all and show up in code coverage reports.
11+
12+
r[attributes.coverage.allowed-positions]
13+
The `coverage` attribute can only be controlled at the function level, but it can be applied to modules, `impl` blocks, or anything that can contain functions.
14+
15+
r[attributes.coverage.syntax]
916
There are two ways to use the coverage attribute:
1017

1118
* `#[coverage(off)]` indicates that all functions within an item, recursively, should not be instrumented, unless specified by another attribute.
1219
* `#[coverage(on)]` (the default) indicates that all functions within an item, recursively, *should* be instrumented, unless specified by another attribute.
1320

21+
r[attributes.coverage.nesting]
1422
More-specific attributes always take priority over less-specific ones, e.g. if a crate is marked `#![coverage(off)]`, then functions inside that crate marked `#[coverage(on)]` will still have coverage.
1523

1624
[attribute]: ../attributes.md

0 commit comments

Comments
 (0)