Skip to content

Commit def932c

Browse files
committedDec 3, 2020
Combination of commits
Fixes multiple issue with counters, with simplification Includes a change to the implicit else span in ast_lowering, so coverage of the implicit else no longer spans the `then` block. Adds coverage for unused closures and async function bodies. Fixes: #78542 Adding unreachable regions for known MIR missing from coverage map Cleaned up PR commits, and removed link-dead-code requirement and tests Coverage no longer depends on Issue #76038 (`-C link-dead-code` is no longer needed or enforced, so MSVC can use the same tests as Linux and MacOS now) Restrict adding unreachable regions to covered files Improved the code that adds coverage for uncalled functions (with MIR but not-codegenned) to avoid generating coverage in files not already included in the files with covered functions. Resolved last known issue requiring --emit llvm-ir workaround Fixed bugs in how unreachable code spans were added.
1 parent f6c9c1a commit def932c

File tree

354 files changed

+12632
-20484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+12632
-20484
lines changed
 

‎compiler/rustc_ast_lowering/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
347347
// `_ => else_block` where `else_block` is `{}` if there's `None`:
348348
let else_pat = self.pat_wild(span);
349349
let (else_expr, contains_else_clause) = match else_opt {
350-
None => (self.expr_block_empty(span), false),
350+
None => (self.expr_block_empty(span.shrink_to_hi()), false),
351351
Some(els) => (self.lower_expr(els), true),
352352
};
353353
let else_arm = self.arm(else_pat, else_expr);

‎compiler/rustc_codegen_llvm/src/attributes.rs

-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ fn set_probestack(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
127127
return;
128128
}
129129

130-
// FIXME(richkadel): Make sure probestack plays nice with `-Z instrument-coverage`
131-
// or disable it if not, similar to above early exits.
132-
133130
// Flag our internal `__rust_probestack` function as the stack probe symbol.
134131
// This is defined in the `compiler-builtins` crate for each architecture.
135132
llvm::AddFunctionAttrStringValue(

0 commit comments

Comments
 (0)