mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
mlua_derive: Reject static field functions with args
This commit is contained in:
@@ -335,6 +335,14 @@ pub fn userdata_impl(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
.to_compile_error()
|
||||
.into();
|
||||
}
|
||||
if !info.args.is_empty() {
|
||||
return syn::Error::new_spanned(
|
||||
&method.sig,
|
||||
"field function must not take arguments",
|
||||
)
|
||||
.to_compile_error()
|
||||
.into();
|
||||
}
|
||||
let lua_name = lua_attr.name(fn_name);
|
||||
if lua_attr.meta {
|
||||
let tokens = quote! {
|
||||
|
||||
Reference in New Issue
Block a user