Skip to content

Commit 1a81f8d

Browse files
committed
Update compile tests
1 parent bedd430 commit 1a81f8d

8 files changed

+30
-30
lines changed

tests/compile/async_nonstatic_userdata.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ note: ...so that the types are compatible
2222
13 | | Ok(())
2323
14 | | });
2424
| |_____________^
25-
= note: expected `main::MyUserData<'_>`
26-
found `main::MyUserData<'a>`
25+
= note: expected `(MyUserData<'_>,)`
26+
found `(MyUserData<'a>,)`
2727
note: but, the lifetime must be valid for the lifetime `'lua` as defined on the method body at 10:24...
2828
--> $DIR/async_nonstatic_userdata.rs:10:24
2929
|
3030
10 | fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M) {
3131
| ^^^^
32-
note: ...so that the type `impl std::future::Future` will meet its required lifetime bounds
32+
note: ...so that the type `impl Future` will meet its required lifetime bounds
3333
--> $DIR/async_nonstatic_userdata.rs:11:21
3434
|
3535
11 | methods.add_async_method("print", |_, data, ()| async move {
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
error[E0277]: the type `std::cell::UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
1+
error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
22
--> $DIR/lua_norefunwindsafe.rs:7:5
33
|
44
7 | catch_unwind(|| lua.create_table().unwrap());
5-
| ^^^^^^^^^^^^ `std::cell::UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
5+
| ^^^^^^^^^^^^ `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
66
|
77
::: $RUST/std/src/panic.rs
88
|
99
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
10-
| ---------- required by this bound in `std::panic::catch_unwind`
10+
| ---------- required by this bound in `catch_unwind`
1111
|
12-
= help: within `mlua::Lua`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<()>`
13-
= note: required because it appears within the type `std::marker::PhantomData<std::cell::UnsafeCell<()>>`
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]`
12+
= help: within `Lua`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<()>`
13+
= note: required because it appears within the type `PhantomData<UnsafeCell<()>>`
14+
= note: required because it appears within the type `Lua`
15+
= note: required because of the requirements on the impl of `UnwindSafe` for `&Lua`
16+
= note: required because it appears within the type `[closure@$DIR/tests/compile/lua_norefunwindsafe.rs:7:18: 7:48]`

tests/compile/non_send.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
1+
error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
22
--> $DIR/non_send.rs:11:9
33
|
44
11 | lua.create_function(move |_, ()| {
55
| _________^^^^^^^^^^^^^^^_-
66
| | |
7-
| | `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
7+
| | `Rc<Cell<i32>>` cannot be sent between threads safely
88
12 | | Ok(data.get())
99
13 | | })?
10-
| |_____- within this `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6 data:std::rc::Rc<std::cell::Cell<i32>>]`
10+
| |_____- within this `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6]`
1111
|
12-
= help: within `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6 data:std::rc::Rc<std::cell::Cell<i32>>]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<i32>>`
13-
= note: required because it appears within the type `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6 data:std::rc::Rc<std::cell::Cell<i32>>]`
14-
= note: required because of the requirements on the impl of `mlua::types::MaybeSend` for `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6 data:std::rc::Rc<std::cell::Cell<i32>>]`
12+
= help: within `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6]`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
13+
= note: required because it appears within the type `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6]`
14+
= note: required because of the requirements on the impl of `mlua::types::MaybeSend` for `[closure@$DIR/tests/compile/non_send.rs:11:25: 13:6]`

tests/compile/ref_nounwindsafe.stderr

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

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<'_, '2>`
22+
| ----- has type `&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<'_>>`
30+
| borrow might be used here, when `outer` is dropped and runs the destructor for type `Option<LuaTable<'_>>`

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<'_, '1>`
5+
| ----- has type `&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<'_, '1>`
5+
| ----- has type `&Scope<'_, '1>`
66
...
77
15 | scope.create_nonstatic_userdata(MyUserData(&ibad)).unwrap();
88
| -------------------------------------------^^^^^--

0 commit comments

Comments
 (0)