From 2cf140a869e06937ed2d21597913fa2d89eddcf6 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 26 Nov 2019 10:01:46 +0600 Subject: [PATCH] inclide fn token to err message --- actix-macros/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/actix-macros/src/lib.rs b/actix-macros/src/lib.rs index 8d628e01..884958f6 100644 --- a/actix-macros/src/lib.rs +++ b/actix-macros/src/lib.rs @@ -68,9 +68,12 @@ pub fn test(_: TokenStream, item: TokenStream) -> TokenStream { } if input.sig.asyncness.is_none() { - return syn::Error::new_spanned(input.sig.fn_token, "only async fn is supported") - .to_compile_error() - .into(); + return syn::Error::new_spanned( + input.sig.fn_token, + format!("only async fn is supported, {:?}", input.sig.fn_token), + ) + .to_compile_error() + .into(); } let result = if has_test_attr {