error[E0597]: `instance` does not live long enough
--> src/fail_tests/move_ref_outside_closure.rs:17:5
|
11 | let instance = BoxAndRefBuilder {
| -------- binding `instance` declared here
...
16 | let mut stored_ref: Option<&'static i32> = None;
| -------------------- type annotation requires that `instance` is borrowed for `'static`
17 | instance.with_data_ref(|dref| stored_ref = Some(*dref));
| ^^^^^^^^ borrowed value does not live long enough
18 | }
| - `instance` dropped here while still borrowed
|
note: requirement that the value outlives `'static` introduced here
--> src/fail_tests/move_ref_outside_closure.rs:3:1
|
3 | #[self_referencing]
| ^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `self_referencing` (in Nightly builds, run with -Z macro-backtrace for more info)