Skip to content
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

Function visibility removed on async-trait like functions with tracing::instrument #976

Closed
Txuritan opened this issue Sep 15, 2020 · 3 comments · Fixed by #977
Closed

Function visibility removed on async-trait like functions with tracing::instrument #976

Txuritan opened this issue Sep 15, 2020 · 3 comments · Fixed by #977
Labels
crate/attributes Related to the `tracing-attributes` crate kind/bug Something isn't working

Comments

@Txuritan
Copy link
Contributor

Bug Report

Version

tracing v0.1.19
tracing-appender v0.1.1
tracing-attributes v0.1.11
tracing-core v0.1.15
tracing-flame v0.1.0
tracing-futures v0.2.4
tracing-log v0.1.1
tracing-subscriber v0.2.11

Platform

Windows (64-bit)

Crates

tracing-attributes

Description

Due to the implementation of async-trait support in tracing-attributes, if it detects what it thinks is async-trait or something based off of it, it will removed the visibility of any attributed function.

Adding the visibility back to the rewritten function would fix this as input.vis will only be Some on non trait impls and None for traits.

I made a fork for myself to temporarily fix tis: Txuritan@943510c;

@hawkw
Copy link
Member

hawkw commented Sep 15, 2020

Thanks, that looks like a bug to me, too. We'd happily merge a pull request from your fork!

@hawkw hawkw added crate/attributes Related to the `tracing-attributes` crate kind/bug Something isn't working labels Sep 15, 2020
Txuritan added a commit to Txuritan/tracing that referenced this issue Sep 15, 2020
Instrument removes the visibility of function that looks like its

from async-trait even if its not inside a trait impl block. This

adds it back for support of proc-macro based off async-trait.

Fixed: tokio-rs#976
Txuritan added a commit to Txuritan/tracing that referenced this issue Sep 15, 2020
Instrument removes the visibility of function that looks like its
from async-trait even if its not inside a trait impl block. This
adds it back for support of proc-macros based off async-trait.

Fixes: tokio-rs#976
@Txuritan
Copy link
Contributor Author

Submitted.

Had some trouble with my commit message though, sorry for the unneeded noise.

@hawkw
Copy link
Member

hawkw commented Sep 15, 2020

Thanks! We'll merge it pending CI.

hawkw pushed a commit that referenced this issue Sep 15, 2020
Instrument removes the visibility of function that looks like its
from async-trait even if its not inside a trait impl block. This
adds it back for support of proc-macros based off async-trait.

Fixes: #976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/attributes Related to the `tracing-attributes` crate kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants