-
Notifications
You must be signed in to change notification settings - Fork 844
Closed
Labels
crate/attributesRelated to the `tracing-attributes` crateRelated to the `tracing-attributes` cratekind/bugSomething isn't workingSomething isn't working
Description
Bug Report
Version
│ │ └── tracing v0.1.25
│ │ ├── tracing-attributes v0.1.14 (proc-macro)
│ │ └── tracing-core v0.1.17
│ ├── tracing v0.1.25 (*)
│ └── tracing v0.1.25 (*)
│ └── tracing v0.1.25 (*)
├── tracing v0.1.25 (*)
├── tracing-core v0.1.17 (*)
├── tracing-futures v0.2.5
│ └── tracing v0.1.25 (*)
├── tracing-log v0.1.2
│ └── tracing-core v0.1.17 (*)
├── tracing-subscriber v0.2.16
│ ├── tracing v0.1.25 (*)
│ ├── tracing-core v0.1.17 (*)
│ ├── tracing-log v0.1.2 (*)
│ └── tracing-serde v0.1.2
│ └── tracing-core v0.1.17 (*)
Platform
Darwin Kernel Version 20.3.0 (AMR64)
Crates
tracing-attributes
Description
Upgrading to tracing-attributes 0.1.14 appears to be placing variables out of scope.
I don't exactly have a minimal reproduction, but here's roughly the code that causes it:
#[instrument(skip(self, req), fields(app_id))]
fn call(&mut self, req: (Req, IpAddr)) -> Self::Future {
// ...
let metrics = self.metrics.clone();
// ...
Box::pin(async move {
// ...
metrics // cannot find value `metrics` in this scope
})
}Removing #[instrument(...)] fixes the issue.
Metadata
Metadata
Assignees
Labels
crate/attributesRelated to the `tracing-attributes` crateRelated to the `tracing-attributes` cratekind/bugSomething isn't workingSomething isn't working