mlua/tests/compile_fail/scope_callback_inner.rs

16 lines
348 B
Rust
Raw Normal View History

2020-05-06 20:18:56 -04:00
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(())
});
}