mlua 0.11.4

High level bindings to Lua 5.4/5.3/5.2/5.1 (including LuaJIT) and Luau with async/await features and support of writing native Lua modules in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
error[E0373]: closure may outlive the current function, but it borrows `test.0`, which is owned by the current function
 --> tests/compile/function_borrow.rs:9:33
  |
9 |     let _ = lua.create_function(|_, ()| -> Result<i32> { Ok(test.0) });
  |                                 ^^^^^^^^^^^^^^^^^^^^^^      ------ `test.0` is borrowed here
  |                                 |
  |                                 may outlive borrowed value `test.0`
  |
note: function requires argument type to outlive `'static`
 --> tests/compile/function_borrow.rs:9:13
  |
9 |     let _ = lua.create_function(|_, ()| -> Result<i32> { Ok(test.0) });
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to force the closure to take ownership of `test.0` (and any other referenced variables), use the `move` keyword
  |
9 |     let _ = lua.create_function(move |_, ()| -> Result<i32> { Ok(test.0) });
  |                                 ++++