From 939cae8c4610f121f9a4b3194975de5a9e9a9d98 Mon Sep 17 00:00:00 2001 From: cyrgani Date: Sun, 12 Jan 2025 21:27:54 +0100 Subject: [PATCH] add help message for `#[macroquad::main]` on a non-async function --- macroquad_macro/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/macroquad_macro/src/lib.rs b/macroquad_macro/src/lib.rs index 76b2249b..4b20f7f4 100644 --- a/macroquad_macro/src/lib.rs +++ b/macroquad_macro/src/lib.rs @@ -80,7 +80,11 @@ pub fn main(attr: TokenStream, item: TokenStream) -> TokenStream { }; if let TokenTree::Ident(ident) = source.next().unwrap() { - assert_eq!(format!("{}", ident), "async"); + assert_eq!( + format!("{}", ident), + "async", + "[macroquad::main] is allowed only for async functions" + ); modified.extend(std::iter::once(TokenTree::Ident(ident))); } else {