mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
90 lines
4.1 KiB
Plaintext
90 lines
4.1 KiB
Plaintext
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<mlua::state::RawLua>`, 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<T: ?Sized> {
|
|
| ^^^^
|
|
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<mlua::state::RawLua>`
|
|
--> src/types/sync.rs
|
|
|
|
|
| pub(crate) struct ReentrantMutex<T>(T);
|
|
| ^^^^^^^^^^^^^^
|
|
= note: required for `Rc<mlua::types::sync::inner::ReentrantMutex<mlua::state::RawLua>>` 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<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
|
|
| ^^^^^^^^^^ required by this bound in `catch_unwind`
|
|
|
|
error[E0277]: the type `UnsafeCell<state::extra::ExtraData>` 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<state::extra::ExtraData>` 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<state::extra::ExtraData>`
|
|
= note: required for `Rc<UnsafeCell<state::extra::ExtraData>>` to implement `RefUnwindSafe`
|
|
note: required because it appears within the type `MaybeDangling<Rc<UnsafeCell<state::extra::ExtraData>>>`
|
|
--> $RUST/core/src/mem/maybe_dangling.rs
|
|
|
|
|
| pub struct MaybeDangling<P: ?Sized>(P);
|
|
| ^^^^^^^^^^^^^
|
|
note: required because it appears within the type `ManuallyDrop<Rc<UnsafeCell<state::extra::ExtraData>>>`
|
|
--> $RUST/core/src/mem/manually_drop.rs
|
|
|
|
|
| pub struct ManuallyDrop<T: ?Sized> {
|
|
| ^^^^^^^^^^^^
|
|
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<mlua::state::RawLua>`
|
|
--> src/types/sync.rs
|
|
|
|
|
| pub(crate) struct ReentrantMutex<T>(T);
|
|
| ^^^^^^^^^^^^^^
|
|
= note: required for `Rc<mlua::types::sync::inner::ReentrantMutex<mlua::state::RawLua>>` 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<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
|
|
| ^^^^^^^^^^ required by this bound in `catch_unwind`
|