rust/compiler/rustc_builtin_macros/src
León Orell Valerian Liehr ecb8702308
Rollup merge of #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 #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.
2024-01-23 21:53:58 +01:00
..
assert Desugar for await loops 2023-12-19 12:26:27 -08:00
deriving Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
format_foreign Use as_deref in compiler (but only where it makes sense) 2022-11-16 21:58:58 +00:00
alloc_error_handler.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
asm.rs Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
assert.rs Make DiagnosticBuilder::emit consuming. 2024-01-08 15:24:49 +11:00
cfg_accessible.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
cfg_eval.rs Make DiagnosticBuilder::emit consuming. 2024-01-08 15:24:49 +11:00
cfg.rs Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
cmdline_attrs.rs Make DiagnosticBuilder::emit consuming. 2024-01-08 15:24:49 +11:00
compile_error.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
concat_bytes.rs Pack the u128 in LitKind::Int 2024-01-19 20:10:39 -08:00
concat_idents.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
concat.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
derive.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
edition_panic.rs Remove MacDelimiter. 2023-08-03 09:03:30 +10:00
env.rs Rename --env option flag to --env-set 2024-01-12 11:02:57 +01:00
errors.rs Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
format_foreign.rs unwrap return Option value, as it always returns Some for some fns 2023-11-28 14:52:21 +03:00
format.rs Tweak error counting. 2024-01-22 10:14:01 +11:00
global_allocator.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
lib.rs Add #[coverage(off)] to closures introduced by #[test]/#[bench] 2024-01-21 23:17:00 +11:00
log_syntax.rs
proc_macro_harness.rs Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
source_util.rs Add check for ui_testing via promoting parameters from ParseSess to Session 2024-01-13 12:11:13 -05:00
standard_library_imports.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
test_harness.rs Rename many DiagCtxt and EarlyDiagCtxt locals. 2023-12-18 16:06:22 +11:00
test.rs Add #[coverage(off)] to closures introduced by #[test]/#[bench] 2024-01-21 23:17:00 +11:00
trace_macros.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
type_ascribe.rs Make DiagnosticBuilder::emit consuming. 2024-01-08 15:24:49 +11:00
util.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00