Skip to content

Commit

Permalink
attributes: update #[instrument] to support async-trait 0.1.43+ (#…
Browse files Browse the repository at this point in the history
…1228)

This backports #1228 from `master` to `v0.1.x`.

It works with both the old and new version of async-trait (except for
one doc test that failed previously, and that works with the new
version). One nice thing is that the code is simpler (e.g.g no self
renaming to _self, which will enable some simplifications in the
future).

A minor nitpick is that I disliked the deeply nested pattern matching in
get_async_trait_kind (previously: get_async_trait_function), so I
"flattened" that a bit.

Fixes  #1219.
  • Loading branch information
nightmared authored and hawkw committed Mar 10, 2021
1 parent 4ad1e62 commit de2ddc5
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 168 deletions.
5 changes: 2 additions & 3 deletions tracing-attributes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ async-await = []

[dependencies]
proc-macro2 = "1"
syn = { version = "1", default-features = false, features = ["full", "parsing", "printing", "visit-mut", "clone-impls", "extra-traits", "proc-macro"] }
syn = { version = "1", default-features = false, features = ["full", "parsing", "printing", "visit", "visit-mut", "clone-impls", "extra-traits", "proc-macro"] }
quote = "1"


[dev-dependencies]
tracing = { path = "../tracing", version = "0.1" }
tokio-test = { version = "0.2.0" }
tracing-core = { path = "../tracing-core", version = "0.1"}
async-trait = "0.1"
async-trait = "0.1.44"

[badges]
maintenance = { status = "experimental" }

0 comments on commit de2ddc5

Please sign in to comment.