2018-02-19 17:40:48 -05:00
|
|
|
extern crate rlua;
|
|
|
|
|
2018-09-16 20:15:51 -04:00
|
|
|
use rlua::{Function, Lua};
|
2018-02-19 17:40:48 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
struct Test {
|
|
|
|
field: i32,
|
|
|
|
}
|
|
|
|
|
|
|
|
let lua = Lua::new();
|
|
|
|
let mut outer: Option<Function> = None;
|
|
|
|
lua.scope(|scope| {
|
|
|
|
let f = scope.create_function_mut(|_, ()| Ok(())).unwrap();
|
|
|
|
outer = Some(scope.create_function_mut(|_, ()| Ok(())).unwrap());
|
|
|
|
//~^ error: borrowed data cannot be stored outside of its closure
|
|
|
|
});
|
|
|
|
}
|