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"
|
"finaliser must take exactly one parameter"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
match lua.params[0] {
|
||||||
|
// should be `self: cdata` PatType
|
||||||
|
Pat::Type(ref ty) => {
|
||||||
syn_assert!(
|
syn_assert!(
|
||||||
pat_ident(&lua.params[0])? == "self",
|
pat_ident(&ty.pat)? == "self",
|
||||||
lua.params[0],
|
lua.params[0],
|
||||||
"finaliser parameter must be `self`"
|
"finaliser parameter must be `self`"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
_ => syn_error!(lua.params[0], "finaliser parameter must be `self`"),
|
||||||
|
}
|
||||||
|
|
||||||
let params = &lua.params;
|
let params = &lua.params;
|
||||||
let body = &lua.body;
|
let body = &lua.body;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user