diff options
Diffstat (limited to 'tests/compile/scope_callback_inner.rs')
-rw-r--r-- | tests/compile/scope_callback_inner.rs | 15 |
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(()) + }); +} |