error[E0277]: the type `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary --> tests/compile/lua_norefunwindsafe.rs:7:18 | 7 | catch_unwind(|| lua.create_table().unwrap()); | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary | | | required by a bound introduced by this call | = help: within `mlua::types::sync::inner::ReentrantMutex`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<*mut lua_State>` note: required because it appears within the type `Cell<*mut lua_State>` --> $RUST/core/src/cell.rs | | pub struct Cell { | ^^^^ note: required because it appears within the type `mlua::state::RawLua` --> src/state/raw.rs | | pub struct RawLua { | ^^^^^^ note: required because it appears within the type `mlua::types::sync::inner::ReentrantMutex` --> src/types/sync.rs | | pub(crate) struct ReentrantMutex(T); | ^^^^^^^^^^^^^^ = note: required for `Rc>` to implement `RefUnwindSafe` note: required because it appears within the type `Lua` --> src/state.rs | | pub struct Lua { | ^^^ = note: required for `&Lua` to implement `UnwindSafe` note: required because it's used within this closure --> tests/compile/lua_norefunwindsafe.rs:7:18 | 7 | catch_unwind(|| lua.create_table().unwrap()); | ^^ note: required by a bound in `std::panic::catch_unwind` --> $RUST/std/src/panic.rs | | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { | ^^^^^^^^^^ required by this bound in `catch_unwind` error[E0277]: the type `UnsafeCell` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary --> tests/compile/lua_norefunwindsafe.rs:7:18 | 7 | catch_unwind(|| lua.create_table().unwrap()); | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary | | | required by a bound introduced by this call | = help: the trait `RefUnwindSafe` is not implemented for `UnsafeCell` = note: required for `Rc>` to implement `RefUnwindSafe` note: required because it appears within the type `MaybeDangling>>` --> $RUST/core/src/mem/maybe_dangling.rs | | pub struct MaybeDangling(P); | ^^^^^^^^^^^^^ note: required because it appears within the type `ManuallyDrop>>` --> $RUST/core/src/mem/manually_drop.rs | | pub struct ManuallyDrop { | ^^^^^^^^^^^^ note: required because it appears within the type `mlua::state::RawLua` --> src/state/raw.rs | | pub struct RawLua { | ^^^^^^ note: required because it appears within the type `mlua::types::sync::inner::ReentrantMutex` --> src/types/sync.rs | | pub(crate) struct ReentrantMutex(T); | ^^^^^^^^^^^^^^ = note: required for `Rc>` to implement `RefUnwindSafe` note: required because it appears within the type `Lua` --> src/state.rs | | pub struct Lua { | ^^^ = note: required for `&Lua` to implement `UnwindSafe` note: required because it's used within this closure --> tests/compile/lua_norefunwindsafe.rs:7:18 | 7 | catch_unwind(|| lua.create_table().unwrap()); | ^^ note: required by a bound in `std::panic::catch_unwind` --> $RUST/std/src/panic.rs | | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { | ^^^^^^^^^^ required by this bound in `catch_unwind`