diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-01-24 15:43:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-24 15:43:12 +0100 |
| commit | 8bd126cb18f71699f12125f0259742580b9173ae (patch) | |
| tree | 8960c1494e4f5f44bd400a3003410150284335d7 /compiler/rustc_codegen_llvm/src/errors.rs | |
| parent | e0a4f43903ac155e7a14bb947f26f0b4f04e587d (diff) | |
| parent | 41dcba805d8ea2c5142cce7044c146aa15d0358c (diff) | |
| download | rust-8bd126cb18f71699f12125f0259742580b9173ae.tar.gz rust-8bd126cb18f71699f12125f0259742580b9173ae.zip | |
Rollup merge of #120185 - Zalathar:auto-derived, r=wesleywiser
coverage: Don't instrument `#[automatically_derived]` functions This PR makes the coverage instrumentor detect and skip functions that have [`#[automatically_derived]`](https://doc.rust-lang.org/reference/attributes/derive.html#the-automatically_derived-attribute) on their enclosing impl block. Most notably, this means that methods generated by built-in derives (e.g. `Clone`, `Debug`, `PartialEq`) are now ignored by coverage instrumentation, and won't appear as executed or not-executed in coverage reports. This is a noticeable change in user-visible behaviour, but overall I think it's a net improvement. For example, we've had a few user requests for this sort of change (e.g. #105055, https://github.com/rust-lang/rust/issues/84605#issuecomment-1902069040), and I believe it's the behaviour that most users will expect/prefer by default. It's possible to imagine situations where users would want to instrument these derived implementations, but I think it's OK to treat that as an opportunity to consider adding more fine-grained option flags to control the details of coverage instrumentation, while leaving this new behaviour as the default. (Also note that while `-Cinstrument-coverage` is a stable feature, the exact details of coverage instrumentation are allowed to change. So we *can* make this change; the main question is whether we *should*.) Fixes #105055.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
