Emit an error when #[async_test] is applied to a function with parameters.

This commit is contained in:
Jeb Rosen 2019-09-22 15:36:17 -07:00 committed by Sergio Benitez
parent 76ef92a2e1
commit 8718561bf8
1 changed files with 3 additions and 1 deletions

View File

@ -11,7 +11,9 @@ fn parse_input(input: TokenStream) -> Result<syn::ItemFn> {
return Err(Span::call_site().error("`#[async_test]` can only be applied to async functions")) return Err(Span::call_site().error("`#[async_test]` can only be applied to async functions"))
} }
// TODO.async: verify of the form `async fn name(/* no args */) -> R` if !function.sig.inputs.is_empty() {
return Err(Span::call_site().error("`#[async_test]` can only be applied to functions with no parameters"));
}
Ok(function) Ok(function)
} }