1
Fork 0

coverage: Discard spans that fill the entire function body

When we try to extract coverage-relevant spans from MIR, sometimes we see MIR
statements/terminators whose spans cover the entire function body. Those spans
tend to be unhelpful for coverage purposes, because they often represent
compiler-inserted code, e.g. the implicit return value of `()`.
This commit is contained in:
Zalathar 2024-02-15 18:12:27 +11:00
parent 75af3c58f9
commit cd9021e8cb
10 changed files with 29 additions and 33 deletions

View file

@ -29,8 +29,7 @@
LL| |
LL| |macro_rules! macro_that_defines_a_function {
LL| | (fn $名:ident () $体:tt) => {
LL| 1| fn $名 () $体 fn 他 () {}
^0
LL| 0| fn $名 () $体 fn 他 () {}
LL| | }
LL| |}
LL| |