1
Fork 0

coverage: Treat await similar to a macro

Currently `await` is only counted towards coverage if the containing
function is suspended and resumed at least once. This is because it
expands to code which contains a branch on the discriminant of `Poll`.

By treating it like a branching macro (e.g. `assert!`), these
implementation details will be hidden from the coverage results.
This commit is contained in:
Jonathan Conder 2024-09-06 10:25:25 +12:00
parent 3446ca535e
commit 25d183057e
8 changed files with 68 additions and 72 deletions

View file

@ -45,9 +45,9 @@
LL| 1| // executed asynchronously.
LL| 1| match x {
LL| 1| y if c(x).await == y + 1 => { d().await; }
^0 ^0 ^0 ^0
^0 ^0
LL| 1| y if f().await == y + 1 => (),
^0 ^0 ^0
^0 ^0
LL| 1| _ => (),
LL| | }
LL| 1|}