From 53f873a482953941ba61c902fdc6312cb5d0e7e8 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Thu, 16 Sep 2021 00:49:17 +0100 Subject: [PATCH] Update compile tests error messages --- tests/compile/function_borrow.stderr | 2 +- tests/compile/lua_norefunwindsafe.stderr | 40 ++++------------------ tests/compile/ref_nounwindsafe.stderr | 42 ++++-------------------- tests/compile/scope_invariance.stderr | 2 +- 4 files changed, 14 insertions(+), 72 deletions(-) diff --git a/tests/compile/function_borrow.stderr b/tests/compile/function_borrow.stderr index c1c4d1f..3612e4b 100644 --- a/tests/compile/function_borrow.stderr +++ b/tests/compile/function_borrow.stderr @@ -4,7 +4,7 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, w 9 | let _ = lua.create_function(|_, ()| -> Result { | ^^^^^^^^^^^^^^^^^^^^^^ may outlive borrowed value `test` 10 | Ok(test.0) - | ---- `test` is borrowed here + | ------ `test` is borrowed here | note: function requires argument type to outlive `'static` --> $DIR/function_borrow.rs:9:13 diff --git a/tests/compile/lua_norefunwindsafe.stderr b/tests/compile/lua_norefunwindsafe.stderr index 9fba8b9..c64b444 100644 --- a/tests/compile/lua_norefunwindsafe.stderr +++ b/tests/compile/lua_norefunwindsafe.stderr @@ -15,49 +15,21 @@ error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a re = 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]` -error[E0277]: the type `UnsafeCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary +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 | 7 | catch_unwind(|| lua.create_table().unwrap()); - | ^^^^^^^^^^^^ `UnsafeCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | ^^^^^^^^^^^^ `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<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` - = note: required because it appears within the type `RefCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` - = note: required because it appears within the type `alloc::sync::ArcInner FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `PhantomData FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `Arc FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `Option FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `mlua::lua::ExtraData` - = note: required because it appears within the type `*mut mlua::lua::ExtraData` - = 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]` - -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 - | -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 `Cell` - = note: required because it appears within the type `RefCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` - = note: required because it appears within the type `alloc::sync::ArcInner FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `PhantomData FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `Arc FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `Option FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `mlua::lua::ExtraData` - = note: required because it appears within the type `*mut mlua::lua::ExtraData` + = 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>>` + = note: required because it appears within the type `Arc>` = 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]` diff --git a/tests/compile/ref_nounwindsafe.stderr b/tests/compile/ref_nounwindsafe.stderr index b961355..7103764 100644 --- a/tests/compile/ref_nounwindsafe.stderr +++ b/tests/compile/ref_nounwindsafe.stderr @@ -17,51 +17,21 @@ error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a re = 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]` -error[E0277]: the type `UnsafeCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary +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 | 8 | catch_unwind(move || table.set("a", "b").unwrap()); - | ^^^^^^^^^^^^ `UnsafeCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | ^^^^^^^^^^^^ `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<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` - = note: required because it appears within the type `RefCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` - = note: required because it appears within the type `alloc::sync::ArcInner FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `PhantomData FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `Arc FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `Option FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `mlua::lua::ExtraData` - = note: required because it appears within the type `*mut mlua::lua::ExtraData` - = 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 `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]` - -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 - | -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 `Cell` - = note: required because it appears within the type `RefCell<(dyn for<'r, 's> FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>` - = note: required because it appears within the type `alloc::sync::ArcInner FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `PhantomData FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `Arc FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>` - = note: required because it appears within the type `Option FnMut(&'r Lua, mlua::Debug<'s>) -> Result<(), LuaError> + 'static)>>>` - = note: required because it appears within the type `mlua::lua::ExtraData` - = note: required because it appears within the type `*mut mlua::lua::ExtraData` + = 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>>` + = note: required because it appears within the type `Arc>` = 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 `mlua::types::LuaRef<'_>` diff --git a/tests/compile/scope_invariance.stderr b/tests/compile/scope_invariance.stderr index a91260c..5b2aa3c 100644 --- a/tests/compile/scope_invariance.stderr +++ b/tests/compile/scope_invariance.stderr @@ -7,7 +7,7 @@ error[E0373]: closure may outlive the current function, but it borrows `test`, w 14 | .create_function_mut(|_, ()| { | ^^^^^^^ may outlive borrowed value `test` 15 | test.field = 42; - | ---- `test` is borrowed here + | ---------- `test` is borrowed here | note: function requires argument type to outlive `'1` --> $DIR/scope_invariance.rs:13:13