From 7a8cbe7da5c214da65dd0fd9179a3d14d3f28eb4 Mon Sep 17 00:00:00 2001 From: andylokandy Date: Sat, 31 Jan 2026 02:02:36 +0800 Subject: [PATCH] fix: attach function span to the generated block --- fastrace-macro/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastrace-macro/src/lib.rs b/fastrace-macro/src/lib.rs index 219dc9e..ae32307 100644 --- a/fastrace-macro/src/lib.rs +++ b/fastrace-macro/src/lib.rs @@ -187,7 +187,8 @@ pub fn trace( .. } = sig; - quote::quote!( + let fn_span = ident.span(); + quote::quote_spanned!(fn_span=> #(#attrs) * #vis #constness #unsafety #asyncness #abi fn #ident<#gen_params>(#params) #return_type #where_clause