mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
22 lines
847 B
Plaintext
22 lines
847 B
Plaintext
error[E0597]: `ibad` does not live long enough
|
|
--> tests/compile/scope_userdata_borrow.rs:15:46
|
|
|
|
|
11 | lua.scope(|scope| {
|
|
| ----- has type `&mlua::Scope<'_, '1>`
|
|
...
|
|
14 | let ibad = 42;
|
|
| ---- binding `ibad` declared here
|
|
15 | scope.create_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
|
|
|
|
|
note: requirement that the value outlives `'1` introduced here
|
|
--> src/scope.rs
|
|
|
|
|
| T: UserData + 'env,
|
|
| ^^^^
|