diff --git a/tracing-attributes/src/expand.rs b/tracing-attributes/src/expand.rs index 321f0ce810..8acc9e6e19 100644 --- a/tracing-attributes/src/expand.rs +++ b/tracing-attributes/src/expand.rs @@ -92,7 +92,7 @@ pub(crate) fn gen_function<'a, B: ToTokens + 'a>( quote!( #(#outer_attrs) * - #vis #constness #unsafety #asyncness #abi fn #ident<#gen_params>(#params) #output + #vis #constness #asyncness #unsafety #abi fn #ident<#gen_params>(#params) #output #where_clause { #(#inner_attrs) * diff --git a/tracing-attributes/tests/async_fn.rs b/tracing-attributes/tests/async_fn.rs index 1d92734007..affa89ea35 100644 --- a/tracing-attributes/tests/async_fn.rs +++ b/tracing-attributes/tests/async_fn.rs @@ -31,6 +31,9 @@ async fn test_ret_impl_trait_err(n: i32) -> Result, &' #[instrument] async fn test_async_fn_empty() {} +#[instrument] +async unsafe fn test_async_unsafe_fn_empty() {} + // Reproduces a compile error when an instrumented function body contains inner // attributes (https://github.com/tokio-rs/tracing/issues/2294). #[deny(unused_variables)]