-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
121 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
error[E0597]: `lua` does not live long enough | ||
--> tests/compile/static_callback_args.rs:12:5 | ||
| | ||
10 | let lua = Lua::new(); | ||
| --- binding `lua` declared here | ||
10 | let lua = Lua::new(); | ||
| --- binding `lua` declared here | ||
11 | | ||
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 | ||
12 | lua.create_function(|_, table: Table| { | ||
| ^^^ borrowed value does not live long enough | ||
13 | / BAD_TIME.with(|bt| { | ||
14 | | *bt.borrow_mut() = Some(table); | ||
15 | | }); | ||
| |__________- argument requires that `lua` is borrowed for `'static` | ||
... | ||
32 | } | ||
| - `lua` dropped here while still borrowed | ||
32 | } | ||
| - `lua` dropped here while still borrowed | ||
|
||
error[E0505]: cannot move out of `lua` because it is borrowed | ||
--> tests/compile/static_callback_args.rs:22:10 | ||
| | ||
10 | let lua = Lua::new(); | ||
| --- binding `lua` declared here | ||
10 | let lua = Lua::new(); | ||
| --- binding `lua` declared here | ||
11 | | ||
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 | ||
12 | lua.create_function(|_, table: Table| { | ||
| --- borrow of `lua` occurs here | ||
13 | / BAD_TIME.with(|bt| { | ||
14 | | *bt.borrow_mut() = Some(table); | ||
15 | | }); | ||
| |__________- argument requires that `lua` is borrowed for `'static` | ||
... | ||
22 | drop(lua); | ||
| ^^^ move out of `lua` occurs here | ||
22 | drop(lua); | ||
| ^^^ move out of `lua` occurs here |