You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a reproduction in davidbarsky/tracing-coverage-reproduction. Note that to reproduce this issue, llvm-tools-preview and grcov are required. To install those tools:
β― uname -a
Darwin dbarsky-mbp 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64
β― rustc --version
rustc 1.62.0-nightly (ec77f2524 2022-04-17)
β― cargo --version
cargo 1.62.0-nightly (dba5baf43 2022-04-13)
β― grcov --version
grcov 0.8.9
β― rustup show
Default host: aarch64-apple-darwin
rustup home: /Users/dbarsky/.rustup
installed toolchains
--------------------
stable-aarch64-apple-darwin (default)
nightly-2021-11-29-aarch64-apple-darwin
nightly-aarch64-apple-darwin
active toolchain
----------------
nightly-aarch64-apple-darwin (directory override for '/Users/dbarsky/Developer/coverage-repro')
rustc 1.62.0-nightly (ec77f2524 2022-04-17)
Crates
tracing 0.1.32
Description
The #[instrument] macro appears to mess with the LLVM's code coverage. This might be inherent to macros that rewrite function bodies, as #[instrument] does. Here is the code coverage on a function decorated with #[instrument]:
I've confirmed that #[async_trait] doesn't have this issue. cargo rustc --profile=check -- -Zunpretty=expanded does show that the #[instrument] macro expands into something a bit more complex than #[async_trait].
Bug Report
Version
I made a reproduction in davidbarsky/tracing-coverage-reproduction. Note that to reproduce this issue,
llvm-tools-preview
andgrcov
are required. To install those tools:Platform
Crates
tracing 0.1.32
Description
The
#[instrument]
macro appears to mess with the LLVM's code coverage. This might be inherent to macros that rewrite function bodies, as#[instrument]
does. Here is the code coverage on a function decorated with#[instrument]
:...and here is a function without
#[instrument]
:(This was reported to me by @DirectXMan12.)
The text was updated successfully, but these errors were encountered: