Update compile tests error messages

This commit is contained in:
Alex Orlenko 2020-09-28 23:24:53 +01:00
parent 68378a3957
commit a52135b62d
6 changed files with 23 additions and 13 deletions

View File

@ -4,8 +4,13 @@ error[E0277]: the type `std::cell::UnsafeCell<()>` may contain interior mutabili
7 | catch_unwind(|| lua.create_table().unwrap()); 7 | catch_unwind(|| lua.create_table().unwrap());
| ^^^^^^^^^^^^ `std::cell::UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | ^^^^^^^^^^^^ `std::cell::UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
| |
= help: within `mlua::lua::Lua`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<()>` ::: $RUST/src/libstd/panic.rs
|
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ---------- required by this bound in `std::panic::catch_unwind`
|
= help: within `mlua::Lua`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<()>`
= note: required because it appears within the type `std::marker::PhantomData<std::cell::UnsafeCell<()>>` = note: required because it appears within the type `std::marker::PhantomData<std::cell::UnsafeCell<()>>`
= note: required because it appears within the type `mlua::lua::Lua` = note: required because it appears within the type `mlua::Lua`
= note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&mlua::lua::Lua` = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&mlua::Lua`
= note: required because it appears within the type `[closure@$DIR/tests/compile/lua_norefunwindsafe.rs:7:18: 7:48 lua:&mlua::lua::Lua]` = note: required because it appears within the type `[closure@$DIR/tests/compile/lua_norefunwindsafe.rs:7:18: 7:48 lua:&mlua::Lua]`

View File

@ -4,10 +4,15 @@ error[E0277]: the type `std::cell::UnsafeCell<()>` may contain interior mutabili
8 | catch_unwind(move || table.set("a", "b").unwrap()); 8 | catch_unwind(move || table.set("a", "b").unwrap());
| ^^^^^^^^^^^^ `std::cell::UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | ^^^^^^^^^^^^ `std::cell::UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
| |
= help: within `mlua::lua::Lua`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<()>` ::: $RUST/src/libstd/panic.rs
|
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ---------- required by this bound in `std::panic::catch_unwind`
|
= help: within `mlua::Lua`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<()>`
= note: required because it appears within the type `std::marker::PhantomData<std::cell::UnsafeCell<()>>` = note: required because it appears within the type `std::marker::PhantomData<std::cell::UnsafeCell<()>>`
= note: required because it appears within the type `mlua::lua::Lua` = note: required because it appears within the type `mlua::Lua`
= note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&mlua::lua::Lua` = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&mlua::Lua`
= note: required because it appears within the type `mlua::types::LuaRef<'_>` = note: required because it appears within the type `mlua::types::LuaRef<'_>`
= note: required because it appears within the type `mlua::table::Table<'_>` = note: required because it appears within the type `mlua::Table<'_>`
= note: required because it appears within the type `[closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:54 table:mlua::table::Table<'_>]` = note: required because it appears within the type `[closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:54 table:mlua::Table<'_>]`

View File

@ -19,7 +19,7 @@ error[E0373]: closure may outlive the current function, but it borrows `inner`,
--> $DIR/scope_callback_inner.rs:8:34 --> $DIR/scope_callback_inner.rs:8:34
| |
5 | lua.scope(|scope| { 5 | lua.scope(|scope| {
| ----- has type `&mlua::scope::Scope<'_, '2>` | ----- has type `&mlua::Scope<'_, '2>`
... ...
8 | .create_function_mut(|_, t: Table| { 8 | .create_function_mut(|_, t: Table| {
| ^^^^^^^^^^^^^ may outlive borrowed value `inner` | ^^^^^^^^^^^^^ may outlive borrowed value `inner`

View File

@ -27,4 +27,4 @@ error[E0597]: `outer` does not live long enough
| - | -
| | | |
| `outer` dropped here while still borrowed | `outer` dropped here while still borrowed
| borrow might be used here, when `outer` is dropped and runs the destructor for type `std::option::Option<mlua::table::Table<'_>>` | borrow might be used here, when `outer` is dropped and runs the destructor for type `std::option::Option<mlua::Table<'_>>`

View File

@ -2,7 +2,7 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, w
--> $DIR/scope_invariance.rs:14:38 --> $DIR/scope_invariance.rs:14:38
| |
9 | lua.scope(|scope| { 9 | lua.scope(|scope| {
| ----- has type `&mlua::scope::Scope<'_, '1>` | ----- has type `&mlua::Scope<'_, '1>`
... ...
14 | .create_function_mut(|_, ()| { 14 | .create_function_mut(|_, ()| {
| ^^^^^^^ may outlive borrowed value `test` | ^^^^^^^ may outlive borrowed value `test`

View File

@ -2,7 +2,7 @@ error[E0597]: `ibad` does not live long enough
--> $DIR/scope_userdata_borrow.rs:15:56 --> $DIR/scope_userdata_borrow.rs:15:56
| |
11 | lua.scope(|scope| { 11 | lua.scope(|scope| {
| ----- has type `&mlua::scope::Scope<'_, '1>` | ----- has type `&mlua::Scope<'_, '1>`
... ...
15 | scope.create_nonstatic_userdata(MyUserData(&ibad)).unwrap(); 15 | scope.create_nonstatic_userdata(MyUserData(&ibad)).unwrap();
| -------------------------------------------^^^^^-- | -------------------------------------------^^^^^--