Skip to content

Commit

Permalink
attributes: fix async fn not moving args into body (#342)
Browse files Browse the repository at this point in the history
This fixes compilation errors with `#[instrument]`ed `async fn`s on the
latest nightly. The generated `async` block was not `async move`, so the
function's attributes were not moved into it.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw committed Sep 12, 2019
1 parent b385da6 commit 2d0072a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tracing-attributes/src/lib.rs
Expand Up @@ -170,7 +170,7 @@ pub fn instrument(args: TokenStream, item: TokenStream) -> TokenStream {
let await_kwd = syn::Ident::new("await", block.span());
quote_spanned! {block.span()=>
tracing_futures::Instrument::instrument(
#async_kwd { #block },
#async_kwd move { #block },
__tracing_attr_span
)
.#await_kwd
Expand Down

0 comments on commit 2d0072a

Please sign in to comment.