Skip to content

Reexporting instrument macro searches for tracing as root dependency #3309

Closed
@gheorghitamutu

Description

@gheorghitamutu

Bug Report

Version

tracing = { version = "0.1.41", default-features = true }

Platform

UNIX

Crates

tracing-attributes / tracing

Description

Reexporting tracing from another crate/lib as

pub mod tracing {
    pub use tracing::*;
}

and using it in another crate as

#[tracing::instrument(err)]
fn fn_test() -> Result<Self> {
  Ok(())
}

results in

error[E0433]: failed to resolve: could not find `instrument` in `tracing`
  --> <line>
   |
68 |     #[tracing::instrument(err)]
   |                ^^^^^^^^^^ could not find `instrument` in `tracing`

that can't be fixed unless I'm importing the tracing library into the new module.
That defeats the purpose of reexporting.

A similar issue serde solved here with some custom code. Is there an option to do the same for tracing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions