diff --git a/tests/compile/function_borrow.stderr b/tests/compile/function_borrow.stderr index 3612e4b..e99c287 100644 --- a/tests/compile/function_borrow.stderr +++ b/tests/compile/function_borrow.stderr @@ -1,5 +1,5 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, which is owned by the current function - --> $DIR/function_borrow.rs:9:33 + --> tests/compile/function_borrow.rs:9:33 | 9 | let _ = lua.create_function(|_, ()| -> Result { | ^^^^^^^^^^^^^^^^^^^^^^ may outlive borrowed value `test` @@ -7,7 +7,7 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, w | ------ `test` is borrowed here | note: function requires argument type to outlive `'static` - --> $DIR/function_borrow.rs:9:13 + --> tests/compile/function_borrow.rs:9:13 | 9 | let _ = lua.create_function(|_, ()| -> Result { | _____________^ @@ -17,4 +17,4 @@ note: function requires argument type to outlive `'static` help: to force the closure to take ownership of `test` (and any other referenced variables), use the `move` keyword | 9 | let _ = lua.create_function(move |_, ()| -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ++++ diff --git a/tests/compile/lua_norefunwindsafe.stderr b/tests/compile/lua_norefunwindsafe.stderr index c64b444..0a18a22 100644 --- a/tests/compile/lua_norefunwindsafe.stderr +++ b/tests/compile/lua_norefunwindsafe.stderr @@ -1,31 +1,26 @@ error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary - --> $DIR/lua_norefunwindsafe.rs:7:5 + --> tests/compile/lua_norefunwindsafe.rs:7:5 | 7 | catch_unwind(|| lua.create_table().unwrap()); | ^^^^^^^^^^^^ `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | - ::: $RUST/std/src/panic.rs - | - | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { - | ---------- required by this bound in `catch_unwind` - | = help: within `Lua`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<()>` = note: required because it appears within the type `PhantomData>` = note: required because it appears within the type `Lua` = note: required because of the requirements on the impl of `UnwindSafe` for `&Lua` = note: required because it appears within the type `[closure@$DIR/tests/compile/lua_norefunwindsafe.rs:7:18: 7:48]` +note: required by a bound in `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 transferrable across a catch_unwind boundary - --> $DIR/lua_norefunwindsafe.rs:7:5 + --> tests/compile/lua_norefunwindsafe.rs:7:5 | 7 | catch_unwind(|| lua.create_table().unwrap()); | ^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | - ::: $RUST/std/src/panic.rs - | - | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { - | ---------- required by this bound in `catch_unwind` - | = help: within `Lua`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` = note: required because it appears within the type `alloc::sync::ArcInner>` = note: required because it appears within the type `PhantomData>>` @@ -33,3 +28,8 @@ error[E0277]: the type `UnsafeCell` may contain interior m = note: required because it appears within the type `Lua` = note: required because of the requirements on the impl of `UnwindSafe` for `&Lua` = note: required because it appears within the type `[closure@$DIR/tests/compile/lua_norefunwindsafe.rs:7:18: 7:48]` +note: required by a bound in `catch_unwind` + --> $RUST/std/src/panic.rs + | + | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { + | ^^^^^^^^^^ required by this bound in `catch_unwind` diff --git a/tests/compile/ref_nounwindsafe.stderr b/tests/compile/ref_nounwindsafe.stderr index 7103764..0441da5 100644 --- a/tests/compile/ref_nounwindsafe.stderr +++ b/tests/compile/ref_nounwindsafe.stderr @@ -1,14 +1,9 @@ error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary - --> $DIR/ref_nounwindsafe.rs:8:5 + --> tests/compile/ref_nounwindsafe.rs:8:5 | 8 | catch_unwind(move || table.set("a", "b").unwrap()); | ^^^^^^^^^^^^ `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | - ::: $RUST/std/src/panic.rs - | - | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { - | ---------- required by this bound in `catch_unwind` - | = help: within `Lua`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<()>` = note: required because it appears within the type `PhantomData>` = note: required because it appears within the type `Lua` @@ -16,18 +11,18 @@ error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a re = note: required because it appears within the type `mlua::types::LuaRef<'_>` = note: required because it appears within the type `LuaTable<'_>` = note: required because it appears within the type `[closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:54]` +note: required by a bound in `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 transferrable across a catch_unwind boundary - --> $DIR/ref_nounwindsafe.rs:8:5 + --> tests/compile/ref_nounwindsafe.rs:8:5 | 8 | catch_unwind(move || table.set("a", "b").unwrap()); | ^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | - ::: $RUST/std/src/panic.rs - | - | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { - | ---------- required by this bound in `catch_unwind` - | = help: within `Lua`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` = note: required because it appears within the type `alloc::sync::ArcInner>` = note: required because it appears within the type `PhantomData>>` @@ -37,3 +32,8 @@ error[E0277]: the type `UnsafeCell` may contain interior m = note: required because it appears within the type `mlua::types::LuaRef<'_>` = note: required because it appears within the type `LuaTable<'_>` = note: required because it appears within the type `[closure@$DIR/tests/compile/ref_nounwindsafe.rs:8:18: 8:54]` +note: required by a bound in `catch_unwind` + --> $RUST/std/src/panic.rs + | + | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { + | ^^^^^^^^^^ required by this bound in `catch_unwind` diff --git a/tests/compile/scope_callback_inner.stderr b/tests/compile/scope_callback_inner.stderr index 6718c98..c2abbe7 100644 --- a/tests/compile/scope_callback_inner.stderr +++ b/tests/compile/scope_callback_inner.stderr @@ -1,5 +1,5 @@ error[E0521]: borrowed data escapes outside of closure - --> $DIR/scope_callback_inner.rs:7:17 + --> tests/compile/scope_callback_inner.rs:7:17 | 5 | lua.scope(|scope| { | ----- @@ -16,7 +16,7 @@ error[E0521]: borrowed data escapes outside of closure | |______________^ `scope` escapes the closure body here error[E0373]: closure may outlive the current function, but it borrows `inner`, which is owned by the current function - --> $DIR/scope_callback_inner.rs:8:34 + --> tests/compile/scope_callback_inner.rs:8:34 | 5 | lua.scope(|scope| { | ----- has type `&Scope<'_, '2>` @@ -27,7 +27,7 @@ error[E0373]: closure may outlive the current function, but it borrows `inner`, | ----- `inner` is borrowed here | note: function requires argument type to outlive `'2` - --> $DIR/scope_callback_inner.rs:7:17 + --> tests/compile/scope_callback_inner.rs:7:17 | 7 | let f = scope | _________________^ @@ -39,4 +39,4 @@ note: function requires argument type to outlive `'2` help: to force the closure to take ownership of `inner` (and any other referenced variables), use the `move` keyword | 8 | .create_function_mut(move |_, t: Table| { - | ^^^^^^^^^^^^^^^^^^ + | ++++ diff --git a/tests/compile/scope_invariance.stderr b/tests/compile/scope_invariance.stderr index 5b2aa3c..b1e68fb 100644 --- a/tests/compile/scope_invariance.stderr +++ b/tests/compile/scope_invariance.stderr @@ -1,5 +1,5 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, which is owned by the current function - --> $DIR/scope_invariance.rs:14:38 + --> tests/compile/scope_invariance.rs:14:38 | 9 | lua.scope(|scope| { | ----- has type `&Scope<'_, '1>` @@ -10,7 +10,7 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, w | ---------- `test` is borrowed here | note: function requires argument type to outlive `'1` - --> $DIR/scope_invariance.rs:13:13 + --> tests/compile/scope_invariance.rs:13:13 | 13 | / scope 14 | | .create_function_mut(|_, ()| { @@ -22,4 +22,4 @@ note: function requires argument type to outlive `'1` help: to force the closure to take ownership of `test` (and any other referenced variables), use the `move` keyword | 14 | .create_function_mut(move |_, ()| { - | ^^^^^^^^^^^^ + | ++++