From 25d183057edcf5d24ba0dcc8d5222a2a954aa80f Mon Sep 17 00:00:00 2001 From: Jonathan Conder Date: Fri, 6 Sep 2024 10:25:25 +1200 Subject: 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. --- tests/coverage/async.coverage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/coverage/async.coverage') diff --git a/tests/coverage/async.coverage b/tests/coverage/async.coverage index f5473829b02..995674257c4 100644 --- a/tests/coverage/async.coverage +++ b/tests/coverage/async.coverage @@ -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|} -- cgit 1.4.1-3-g733a5