-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrument attribute with async-trait breaks include_str #755
Comments
Hmm, that seems very weird. I'm guessing you've already tested that this cannot be reproduced with just |
I have, |
Interesting, thanks! @nightmared since you actually wrote the |
Hum, that's weird, I tried it and I couldn't reproduce ?
And it compiles just fine (this is exactly your example above, with
Maybe I'm missing something ? -- I guess we can compare configurations then: I used tracing/master and async-trait 0.1.30 for this test, with
|
Here's a repo of the project that I used to find the cause. I'm using the latest stable:
If I'm meant to be using nightly then I didn't see it anywhere. |
It does build with nightly on my computer (and no you're not supposed to have to use nightly AFAIK). But you're right, it fails with stable !? |
That's worrying, i will install cargo-expand ( -- Edit: "cargo expand" calls nightly internally, as it relies on |
Funnily enough I tried that as well, and as it couldn't find the file it just replaced it with |
Considering that nightly now works and didn't before, maybe something changed in the handling of proc-macros from 1.44 to 1.46. Edit: I was using 1.43.1 before, I updated to see if that was the issue (it wasn't), so it would what ever version of nightly I had then. |
It was fixed somewhere between nightly-2020-05-15 and nightly-2020-05-30 (Understanding nothing in rustc, I falled back to doing some terrible manual bisecting to narrow the "fix time region" :-p). |
I will try to bisect it further, if I have the time (and courage). Had I to do a completely uneducated guess, I would have said this may be related to rust-lang/rust@d277904#diff-0e785ff001c38d0918429e6a9880f0cd ? |
It does build with the commit I linked previously, so it was fixed before d277904. |
I'm still in the process of narrowing it down, but with |
Great ! Apparently it's rust-lang/rust@9b2b8a5, which is weird, but who am I to understand rustc anyway ? :-p |
Do I have to open an issue on rust ? -- |
Closing this as |
Thanks @nightmared for all your hard work trying to figure this one out! |
Bug Report
Version
tracing v0.1.15
tracing-futures v0.2.4
Platform
Windows (64-bit)
Crates
async-trait v0.1.35
Description
When adding
#[tracing::instrument]
to a function in a#[async_trait::async_trait]
trait implementation,include_str
will think its in the root of the src folder when its not.File tree:
lib.rs
:mod.rs
:The text was updated successfully, but these errors were encountered: