summaryrefslogtreecommitdiff
path: root/tests/compile/scope_callback_inner.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2020-05-12 02:50:58 +0100
committerAlex Orlenko <zxteam@protonmail.com>2020-05-12 03:16:29 +0100
commit1492790eced20ccf6f8e838b72a7c035f21dec6b (patch)
treef0ca4d52e0ee49775a3c06b2d330ef3b4fa93d5f /tests/compile/scope_callback_inner.rs
parente88f086ed8b8db6236adf974db28aa9f846d1de8 (diff)
downloadmlua-1492790eced20ccf6f8e838b72a7c035f21dec6b.zip
Update compile tests to include async/send features
Diffstat (limited to 'tests/compile/scope_callback_inner.rs')
-rw-r--r--tests/compile/scope_callback_inner.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/compile/scope_callback_inner.rs b/tests/compile/scope_callback_inner.rs
new file mode 100644
index 0000000..037c6ac
--- /dev/null
+++ b/tests/compile/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(())
+ });
+}