summaryrefslogtreecommitdiff
path: root/tests/compile_fail/scope_callback_inner.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2020-05-07 01:18:56 +0100
committerAlex Orlenko <zxteam@protonmail.com>2020-05-11 02:43:34 +0100
commitd366ce0dd46cf617d6bf73b76f49f30a17a230e6 (patch)
treed07c653d4fe7335e3b11e3d619a65e497d278ec1 /tests/compile_fail/scope_callback_inner.rs
parent2bd5c2f6ca6c7b87b17a7e035096a4d93160836d (diff)
downloadmlua-d366ce0dd46cf617d6bf73b76f49f30a17a230e6.zip
Scope support (including async)
Diffstat (limited to 'tests/compile_fail/scope_callback_inner.rs')
-rw-r--r--tests/compile_fail/scope_callback_inner.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/compile_fail/scope_callback_inner.rs b/tests/compile_fail/scope_callback_inner.rs
new file mode 100644
index 0000000..037c6ac
--- /dev/null
+++ b/tests/compile_fail/scope_callback_inner.rs
@@ -0,0 +1,15 @@
+use mlua::{Lua, Table};
+
+fn main() {
+ let lua = Lua::new();
+ lua.scope(|scope| {
+ let mut inner: Option<Table> = None;
+ let f = scope
+ .create_function_mut(|_, t: Table| {
+ inner = Some(t);
+ Ok(())
+ })?;
+ f.call::<_, ()>(lua.create_table()?)?;
+ Ok(())
+ });
+}