diff options
| author | Jonathan Conder <jono.conder@gmail.com> | 2024-09-06 10:25:25 +1200 |
|---|---|---|
| committer | Jonathan Conder <jono.conder@gmail.com> | 2024-09-06 17:01:59 +1200 |
| commit | 25d183057edcf5d24ba0dcc8d5222a2a954aa80f (patch) | |
| tree | 5d884401deb678946fbfaad76ffb6feaf6b13c3e /tests/coverage/await_ready.coverage | |
| parent | 3446ca535ecead268a4c8393ba7a48fd783b363a (diff) | |
| download | rust-25d183057edcf5d24ba0dcc8d5222a2a954aa80f.tar.gz rust-25d183057edcf5d24ba0dcc8d5222a2a954aa80f.zip | |
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.
Diffstat (limited to 'tests/coverage/await_ready.coverage')
| -rw-r--r-- | tests/coverage/await_ready.coverage | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/coverage/await_ready.coverage b/tests/coverage/await_ready.coverage index bddaf15cf80..0075f09426e 100644 --- a/tests/coverage/await_ready.coverage +++ b/tests/coverage/await_ready.coverage @@ -8,9 +8,9 @@ LL| |async fn ready() -> u8 { 1 } LL| | LL| 1|async fn await_ready() -> u8 { - LL| 1| // FIXME(#98712): await is only covered if the function yields + LL| 1| // await should be covered even if the function never yields LL| 1| ready() - LL| 0| .await + LL| 1| .await LL| 1|} LL| | LL| 1|fn main() { |
