Commit 636cd08
authored
Rollup merge of rust-lang#120183 - Zalathar:test-closure, r=compiler-errors
Add `#[coverage(off)]` to closures introduced by `#[test]` and `#[bench]`
These closures are an internal implementation detail of the `#[test]` and `#[bench]` attribute macros, so from a user perspective there is no reason to instrument them for coverage.
Skipping them makes coverage reports slightly cleaner, and will also allow other changes to span processing during coverage instrumentation, without having to worry about how they affect the `#[test]` macro.
The `#[coverage(off)]` attribute has no effect when `-Cinstrument-coverage` is not used.
Fixes rust-lang#120046.
---
Note that this PR has no effect on the user-written function that has the `#[test]` attribute attached to it. That function will still be instrumented as normal.1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | | - | |
| 1599 | + | |
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
1612 | | - | |
| 1612 | + | |
1613 | 1613 | | |
1614 | 1614 | | |
1615 | 1615 | | |
| |||
0 commit comments