2020-05-06 20:18:56 -04:00
|
|
|
error[E0597]: `ibad` does not live long enough
|
|
|
|
--> $DIR/scope_userdata_borrow.rs:15:56
|
|
|
|
|
|
|
|
|
11 | lua.scope(|scope| {
|
2020-12-29 18:20:06 -05:00
|
|
|
| ----- has type `&Scope<'_, '1>`
|
2020-05-06 20:18:56 -04:00
|
|
|
...
|
|
|
|
15 | scope.create_nonstatic_userdata(MyUserData(&ibad)).unwrap();
|
|
|
|
| -------------------------------------------^^^^^--
|
|
|
|
| | |
|
|
|
|
| | borrowed value does not live long enough
|
|
|
|
| argument requires that `ibad` is borrowed for `'1`
|
|
|
|
16 | };
|
|
|
|
| - `ibad` dropped here while still borrowed
|