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.
This commit is contained in:
parent
98166358a9
commit
d90fd027c8
5 changed files with 17 additions and 12 deletions
|
@ -32,7 +32,7 @@
|
|||
^0
|
||||
LL| |
|
||||
LL| | if
|
||||
LL| | !
|
||||
LL| 1| !
|
||||
LL| 1| is_true
|
||||
LL| 0| {
|
||||
LL| 0| a = 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue