Auto merge of #114656 - bossmc:rework-no-coverage-attr, r=oli-obk
Rework `no_coverage` to `coverage(off)` As discussed at the tail of https://github.com/rust-lang/rust/issues/84605 this replaces the `no_coverage` attribute with a `coverage` attribute that takes sub-parameters (currently `off` and `on`) to control the coverage instrumentation. Allows future-proofing for things like `coverage(off, reason="Tested live", issue="#12345")` or similar.
This commit is contained in:
commit
c728bf3963
38 changed files with 253 additions and 213 deletions
|
@ -330,10 +330,10 @@ fn add_unused_functions(cx: &CodegenCx<'_, '_>) {
|
|||
{
|
||||
let codegen_fn_attrs = tcx.codegen_fn_attrs(non_codegenned_def_id);
|
||||
|
||||
// If a function is marked `#[no_coverage]`, then skip generating a
|
||||
// If a function is marked `#[coverage(off)]`, then skip generating a
|
||||
// dead code stub for it.
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NO_COVERAGE) {
|
||||
debug!("skipping unused fn marked #[no_coverage]: {:?}", non_codegenned_def_id);
|
||||
debug!("skipping unused fn marked #[coverage(off)]: {:?}", non_codegenned_def_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue