Skip to content

Commit 939cae8

Browse files
cyrganinot-fl3
authored andcommitted
add help message for #[macroquad::main] on a non-async function
1 parent 2f7f3c8 commit 939cae8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

macroquad_macro/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ pub fn main(attr: TokenStream, item: TokenStream) -> TokenStream {
8080
};
8181

8282
if let TokenTree::Ident(ident) = source.next().unwrap() {
83-
assert_eq!(format!("{}", ident), "async");
83+
assert_eq!(
84+
format!("{}", ident),
85+
"async",
86+
"[macroquad::main] is allowed only for async functions"
87+
);
8488

8589
modified.extend(std::iter::once(TokenTree::Ident(ident)));
8690
} else {

0 commit comments

Comments
 (0)