mlua/tests/compile/static_callback_args.stderr

32 lines
1 KiB
Plaintext
Raw Normal View History

2020-05-04 05:56:42 -05:00
error[E0597]: `lua` does not live long enough
2022-04-13 08:30:52 -05:00
--> tests/compile/static_callback_args.rs:12:5
2020-05-04 05:56:42 -05:00
|
2022-08-23 17:12:37 -05:00
12 | / lua.create_function(|_, table: Table| {
13 | | BAD_TIME.with(|bt| {
| |_________-
14 | || *bt.borrow_mut() = Some(table);
15 | || });
| ||__________- argument requires that `lua` is borrowed for `'static`
16 | | Ok(())
17 | | })?
| |______^ borrowed value does not live long enough
2020-05-04 05:56:42 -05:00
...
2022-08-23 17:12:37 -05:00
32 | }
| - `lua` dropped here while still borrowed
2020-05-04 05:56:42 -05:00
error[E0505]: cannot move out of `lua` because it is borrowed
2022-04-13 08:30:52 -05:00
--> tests/compile/static_callback_args.rs:22:10
2020-05-04 05:56:42 -05:00
|
2022-08-23 17:12:37 -05:00
12 | / lua.create_function(|_, table: Table| {
13 | | BAD_TIME.with(|bt| {
| |_________-
14 | || *bt.borrow_mut() = Some(table);
15 | || });
| ||__________- argument requires that `lua` is borrowed for `'static`
16 | | Ok(())
17 | | })?
| |______- borrow of `lua` occurs here
2020-05-04 05:56:42 -05:00
...
2022-08-23 17:12:37 -05:00
22 | drop(lua);
| ^^^ move out of `lua` occurs here