'await' coverage bug workaround help sought

Currently there is an issue with llvm code of the 'await' statement.

Basically awaits don't show as covered/executed even though they have executed.

Here is the issue:

There is a work around on that page:

I would like to modify the Yield type in the sample at the last kink, so that futures can be awaited in a way that fixes the coverage reporting.

One possible idea (based upon the work around)
async_func().await; would become Yield::new(async_func()).await

Yeah, it is hideous, but it would allow checking for 100% code coverage in CI and automated situations like fuzzing.

I am asking here to see if better Rust developers than I can see how to re-write Yield to accomplish a work around so that coverage works correctly for await.


I did write a workaround: GitHub - cameronelliott/await-coverage-workaround

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.