Fix lua finaliser parameter check
This commit is contained in:
parent
01f459ffaf
commit
240e0111bf
@ -745,11 +745,17 @@ fn inject_merged_drop(registry: &mut Registry, lua: Option<&LuaFunction>) -> Res
|
||||
"finaliser must take exactly one parameter"
|
||||
);
|
||||
|
||||
syn_assert!(
|
||||
pat_ident(&lua.params[0])? == "self",
|
||||
lua.params[0],
|
||||
"finaliser parameter must be `self`"
|
||||
);
|
||||
match lua.params[0] {
|
||||
// should be `self: cdata` PatType
|
||||
Pat::Type(ref ty) => {
|
||||
syn_assert!(
|
||||
pat_ident(&ty.pat)? == "self",
|
||||
lua.params[0],
|
||||
"finaliser parameter must be `self`"
|
||||
);
|
||||
}
|
||||
_ => syn_error!(lua.params[0], "finaliser parameter must be `self`"),
|
||||
}
|
||||
|
||||
let params = &lua.params;
|
||||
let body = &lua.body;
|
||||
|
Loading…
x
Reference in New Issue
Block a user