about summary refs log tree commit diff
path: root/tests/coverage/lazy_boolean.coverage
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-11-23 12:50:40 +1100
committerZalathar <Zalathar@users.noreply.github.com>2023-12-08 22:40:49 +1100
commitd90fd027c887247caa501db5f49352fdfab769d9 (patch)
tree07969117a9a6ae2fe624a8692ba261f195459ff9 /tests/coverage/lazy_boolean.coverage
parent98166358a99aea4ded1a42a3c113aac764c752ed (diff)
downloadrust-d90fd027c887247caa501db5f49352fdfab769d9.tar.gz
rust-d90fd027c887247caa501db5f49352fdfab769d9.zip
coverage: Use `SpanMarker` to mark the full condition of `if !`
When MIR is built for an if-not expression, the `!` part of the condition
doesn't correspond to any MIR statement, so coverage instrumentation normally
can't see it.

We can fix that by deliberately injecting a dummy statement whose sole purpose
is to associate that span with its enclosing block.
Diffstat (limited to 'tests/coverage/lazy_boolean.coverage')
-rw-r--r--tests/coverage/lazy_boolean.coverage2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/coverage/lazy_boolean.coverage b/tests/coverage/lazy_boolean.coverage
index 8f14082ef68..2d927a08356 100644
--- a/tests/coverage/lazy_boolean.coverage
+++ b/tests/coverage/lazy_boolean.coverage
@@ -32,7 +32,7 @@
                                           ^0
    LL|       |
    LL|       |    if
-   LL|       |        !
+   LL|      1|        !
    LL|      1|        is_true
    LL|      0|    {
    LL|      0|        a = 2