Skip to content

Commit a52135b

Browse files
committed
Update compile tests error messages
1 parent 68378a3 commit a52135b

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

tests/compile/lua_norefunwindsafe.stderr

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

tests/compile/ref_nounwindsafe.stderr

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

tests/compile/scope_callback_inner.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ error[E0373]: closure may outlive the current function, but it borrows `inner`,
1919
--> $DIR/scope_callback_inner.rs:8:34
2020
|
2121
5 | lua.scope(|scope| {
22-
| ----- has type `&mlua::scope::Scope<'_, '2>`
22+
| ----- has type `&mlua::Scope<'_, '2>`
2323
...
2424
8 | .create_function_mut(|_, t: Table| {
2525
| ^^^^^^^^^^^^^ may outlive borrowed value `inner`

tests/compile/scope_callback_outer.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ error[E0597]: `outer` does not live long enough
2727
| -
2828
| |
2929
| `outer` dropped here while still borrowed
30-
| borrow might be used here, when `outer` is dropped and runs the destructor for type `std::option::Option<mlua::table::Table<'_>>`
30+
| borrow might be used here, when `outer` is dropped and runs the destructor for type `std::option::Option<mlua::Table<'_>>`

tests/compile/scope_invariance.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, w
22
--> $DIR/scope_invariance.rs:14:38
33
|
44
9 | lua.scope(|scope| {
5-
| ----- has type `&mlua::scope::Scope<'_, '1>`
5+
| ----- has type `&mlua::Scope<'_, '1>`
66
...
77
14 | .create_function_mut(|_, ()| {
88
| ^^^^^^^ may outlive borrowed value `test`

tests/compile/scope_userdata_borrow.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0597]: `ibad` does not live long enough
22
--> $DIR/scope_userdata_borrow.rs:15:56
33
|
44
11 | lua.scope(|scope| {
5-
| ----- has type `&mlua::scope::Scope<'_, '1>`
5+
| ----- has type `&mlua::Scope<'_, '1>`
66
...
77
15 | scope.create_nonstatic_userdata(MyUserData(&ibad)).unwrap();
88
| -------------------------------------------^^^^^--

0 commit comments

Comments
 (0)