mlua/tests/compile_fail/scope_userdata_borrow.stderr

14 lines
647 B
Plaintext

error[E0597]: `ibad` does not live long enough
--> $DIR/scope_userdata_borrow.rs:16:56
|
12 | lua.scope(|scope| -> Result<()> {
| ----- has type `&mlua::scope::Scope<'_, '1>`
...
16 | scope.create_nonstatic_userdata(MyUserData(&ibad))?;
| -------------------------------------------^^^^^--
| | |
| | borrowed value does not live long enough
| argument requires that `ibad` is borrowed for `'1`
17 | };
| - `ibad` dropped here while still borrowed