diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-07-01 13:29:54 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-07-08 21:22:56 +1000 |
| commit | 63c04f05e60ce27311fc1b874907188616beb558 (patch) | |
| tree | 3f5586fdf64343de3ac0d65f454fbabe45e98cbd /tests/coverage/async.rs | |
| parent | 9b2c58d1faf2dba1aef0e8556cec8e0ca6b7b996 (diff) | |
| download | rust-63c04f05e60ce27311fc1b874907188616beb558.tar.gz rust-63c04f05e60ce27311fc1b874907188616beb558.zip | |
coverage: Extract hole spans from HIR instead of MIR
This makes it possible to treat more kinds of nested item/code as holes, instead of being restricted to closures.
Diffstat (limited to 'tests/coverage/async.rs')
| -rw-r--r-- | tests/coverage/async.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/tests/coverage/async.rs b/tests/coverage/async.rs index 5018ade0125..7e6ad761ecd 100644 --- a/tests/coverage/async.rs +++ b/tests/coverage/async.rs @@ -54,15 +54,7 @@ fn j(x: u8) { // non-async versions of `c()`, `d()`, and `f()` to make it similar to async `i()`. fn c(x: u8) -> u8 { if x == 8 { - 1 // This line appears covered, but the 1-character expression span covering the `1` - // is not executed. (`llvm-cov show` displays a `^0` below the `1` ). This is because - // `fn j()` executes the open brace for the function body, followed by the function's - // first executable statement, `match x`. Inner function declarations are not - // "visible" to the MIR for `j()`, so the code region counts all lines between the - // open brace and the first statement as executed, which is, in a sense, true. - // `llvm-cov show` overcomes this kind of situation by showing the actual counts - // of the enclosed coverages, (that is, the `1` expression was not executed, and - // accurately displays a `0`). + 1 } else { 0 } |
