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

Build error when using tracing crate #156

Closed
krojew opened this issue Mar 10, 2021 · 3 comments
Closed

Build error when using tracing crate #156

krojew opened this issue Mar 10, 2021 · 3 comments

Comments

@krojew
Copy link

krojew commented Mar 10, 2021

Some changes since version 0.1.42 cause problems when also using the tracing crate. This example code:

#[async_trait]
impl SomeTrait for SomeType {
    #[instrument(skip(self), err)]
    async fn some_fn(&self) -> Result<(), String> {
        ...
    }
}

results in the following build error:

expected struct `Pin`, found enum `std::result::Result`
this expression has type `Pin<Box<impl futures::Future>>`

0.1.42 works fine. Rust version: rustc 1.52.0-nightly (45b3c2851 2021-03-04)

@krojew krojew changed the title Build error with using tracing crate Build error when using tracing crate Mar 10, 2021
@dtolnay
Copy link
Owner

dtolnay commented Mar 10, 2021

This needs to be fixed in the tracing crate. There is some work in tokio-rs/tracing#1228.

@dtolnay dtolnay closed this as completed Mar 10, 2021
@nightmared
Copy link
Contributor

This is merged in tracing, I don't know if a release will be published soon, but I guess you can point to the git repo meanwhile.

@nightmared
Copy link
Contributor

Edit: tracing-attributes 0.1.14 was just published! See https://crates.io/crates/tracing-attributes/0.1.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants