From 076d77c18679e6a7cd36558c3aa06377554d8d20 Mon Sep 17 00:00:00 2001 From: icedrocket <114203630+icedrocket@users.noreply.github.com> Date: Sun, 4 Jun 2023 22:10:59 +0900 Subject: [PATCH] macros: fix diagnostics of last statement (#5762) --- tokio-macros/src/entry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio-macros/src/entry.rs b/tokio-macros/src/entry.rs index edac53029..bcf64aef9 100644 --- a/tokio-macros/src/entry.rs +++ b/tokio-macros/src/entry.rs @@ -354,10 +354,10 @@ fn parse_knobs(mut input: ItemFn, is_test: bool, config: FinalConfig) -> TokenSt }, }; if let Some(v) = config.worker_threads { - rt = quote! { #rt.worker_threads(#v) }; + rt = quote_spanned! {last_stmt_start_span=> #rt.worker_threads(#v) }; } if let Some(v) = config.start_paused { - rt = quote! { #rt.start_paused(#v) }; + rt = quote_spanned! {last_stmt_start_span=> #rt.start_paused(#v) }; } let header = if is_test {