diff --git a/src/lua.rs b/src/lua.rs index 29ba31e..e4b44c1 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -1068,12 +1068,12 @@ impl<'lua, 'scope> Scope<'lua, 'scope> { { unsafe { let f: Box< - Fn(&'callback Lua, MultiValue<'callback>) -> Result>, + Fn(&'callback Lua, MultiValue<'callback>) -> Result> + 'scope, > = Box::new(move |lua, args| { func(lua, A::from_lua_multi(args, lua)?)?.to_lua_multi(lua) }); - // SCARY, we are transmuting away the 'static requirement + // SCARY, we are transmuting the 'scope lifetime to 'static. let mut f = self.lua.create_callback_function(mem::transmute(f))?; f.0.drop_unref = false;