mlua-codemp-patch 0.10.0-beta.2

High level bindings to Lua 5.4/5.3/5.2/5.1 (including LuaJIT) and Roblox Luau with async/await features and support of writing native Lua modules in Rust.
Documentation
error[E0277]: the type `UnsafeCell<usize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
 --> tests/compile/ref_nounwindsafe.rs:8:18
  |
8 |     catch_unwind(move || table.set("a", "b").unwrap());
  |     ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<usize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
  |     |
  |     required by a bound introduced by this call
  |
  = help: within `rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<usize>`, which is required by `{closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:25}: UnwindSafe`
note: required because it appears within the type `Cell<usize>`
 --> $RUST/core/src/cell.rs
  |
  | pub struct Cell<T: ?Sized> {
  |            ^^^^
note: required because it appears within the type `rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
 --> $RUST/alloc/src/rc.rs
  |
  | struct RcBox<T: ?Sized> {
  |        ^^^^^
  = note: required for `NonNull<rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>>` to implement `UnwindSafe`
note: required because it appears within the type `std::rc::Weak<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
 --> $RUST/alloc/src/rc.rs
  |
  | pub struct Weak<
  |            ^^^^
note: required because it appears within the type `mlua::state::WeakLua`
 --> src/state.rs
  |
  | pub(crate) struct WeakLua(XWeak<ReentrantMutex<RawLua>>);
  |                   ^^^^^^^
note: required because it appears within the type `mlua::types::ValueRef`
 --> src/types.rs
  |
  | pub(crate) struct ValueRef {
  |                   ^^^^^^^^
note: required because it appears within the type `LuaTable`
 --> src/table.rs
  |
  | pub struct Table(pub(crate) ValueRef);
  |            ^^^^^
note: required because it's used within this closure
 --> tests/compile/ref_nounwindsafe.rs:8:18
  |
8 |     catch_unwind(move || table.set("a", "b").unwrap());
  |                  ^^^^^^^
note: required by a bound in `std::panic::catch_unwind`
 --> $RUST/std/src/panic.rs
  |
  | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
  |                                        ^^^^^^^^^^ required by this bound in `catch_unwind`

error[E0277]: the type `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
 --> tests/compile/ref_nounwindsafe.rs:8:18
  |
8 |     catch_unwind(move || table.set("a", "b").unwrap());
  |     ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
  |     |
  |     required by a bound introduced by this call
  |
  = help: within `rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<*mut lua_State>`, which is required by `{closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:25}: UnwindSafe`
note: required because it appears within the type `Cell<*mut lua_State>`
 --> $RUST/core/src/cell.rs
  |
  | pub struct Cell<T: ?Sized> {
  |            ^^^^
note: required because it appears within the type `mlua::state::raw::RawLua`
 --> src/state/raw.rs
  |
  | pub struct RawLua {
  |            ^^^^^^
note: required because it appears within the type `mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>`
 --> src/types/sync.rs
  |
  |     pub(crate) struct ReentrantMutex<T>(T);
  |                       ^^^^^^^^^^^^^^
note: required because it appears within the type `rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
 --> $RUST/alloc/src/rc.rs
  |
  | struct RcBox<T: ?Sized> {
  |        ^^^^^
  = note: required for `NonNull<rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>>` to implement `UnwindSafe`
note: required because it appears within the type `std::rc::Weak<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
 --> $RUST/alloc/src/rc.rs
  |
  | pub struct Weak<
  |            ^^^^
note: required because it appears within the type `mlua::state::WeakLua`
 --> src/state.rs
  |
  | pub(crate) struct WeakLua(XWeak<ReentrantMutex<RawLua>>);
  |                   ^^^^^^^
note: required because it appears within the type `mlua::types::ValueRef`
 --> src/types.rs
  |
  | pub(crate) struct ValueRef {
  |                   ^^^^^^^^
note: required because it appears within the type `LuaTable`
 --> src/table.rs
  |
  | pub struct Table(pub(crate) ValueRef);
  |            ^^^^^
note: required because it's used within this closure
 --> tests/compile/ref_nounwindsafe.rs:8:18
  |
8 |     catch_unwind(move || table.set("a", "b").unwrap());
  |                  ^^^^^^^
note: required by a bound in `std::panic::catch_unwind`
 --> $RUST/std/src/panic.rs
  |
  | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
  |                                        ^^^^^^^^^^ required by this bound in `catch_unwind`

error[E0277]: the type `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
 --> tests/compile/ref_nounwindsafe.rs:8:18
  |
8 |     catch_unwind(move || table.set("a", "b").unwrap());
  |     ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
  |     |
  |     required by a bound introduced by this call
  |
  = help: the trait `RefUnwindSafe` is not implemented for `UnsafeCell<mlua::state::extra::ExtraData>`, which is required by `{closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:25}: UnwindSafe`
  = note: required for `Rc<UnsafeCell<mlua::state::extra::ExtraData>>` to implement `RefUnwindSafe`
note: required because it appears within the type `mlua::state::raw::RawLua`
 --> src/state/raw.rs
  |
  | pub struct RawLua {
  |            ^^^^^^
note: required because it appears within the type `mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>`
 --> src/types/sync.rs
  |
  |     pub(crate) struct ReentrantMutex<T>(T);
  |                       ^^^^^^^^^^^^^^
note: required because it appears within the type `rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
 --> $RUST/alloc/src/rc.rs
  |
  | struct RcBox<T: ?Sized> {
  |        ^^^^^
  = note: required for `NonNull<rc::RcBox<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>>` to implement `UnwindSafe`
note: required because it appears within the type `std::rc::Weak<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
 --> $RUST/alloc/src/rc.rs
  |
  | pub struct Weak<
  |            ^^^^
note: required because it appears within the type `mlua::state::WeakLua`
 --> src/state.rs
  |
  | pub(crate) struct WeakLua(XWeak<ReentrantMutex<RawLua>>);
  |                   ^^^^^^^
note: required because it appears within the type `mlua::types::ValueRef`
 --> src/types.rs
  |
  | pub(crate) struct ValueRef {
  |                   ^^^^^^^^
note: required because it appears within the type `LuaTable`
 --> src/table.rs
  |
  | pub struct Table(pub(crate) ValueRef);
  |            ^^^^^
note: required because it's used within this closure
 --> tests/compile/ref_nounwindsafe.rs:8:18
  |
8 |     catch_unwind(move || table.set("a", "b").unwrap());
  |                  ^^^^^^^
note: required by a bound in `std::panic::catch_unwind`
 --> $RUST/std/src/panic.rs
  |
  | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
  |                                        ^^^^^^^^^^ required by this bound in `catch_unwind`