error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements --> $DIR/scope_callback_capture.rs:12:14 | 12 | .create_function_mut(move |lua, t: Table| { | ^^^^^^^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 9:15... --> $DIR/scope_callback_capture.rs:9:15 | 9 | lua.scope(|scope| -> Result<()> { | _______________^ 10 | | let mut inner: Option = None; 11 | | let f = scope 12 | | .create_function_mut(move |lua, t: Table| { ... | 20 | | Ok(()) 21 | | }); | |_____^ note: ...so that reference does not outlive borrowed content --> $DIR/scope_callback_capture.rs:11:17 | 11 | let f = scope | ^^^^^ note: but, the lifetime must be valid for the method call at 9:5... --> $DIR/scope_callback_capture.rs:9:5 | 9 | / lua.scope(|scope| -> Result<()> { 10 | | let mut inner: Option
= None; 11 | | let f = scope 12 | | .create_function_mut(move |lua, t: Table| { ... | 20 | | Ok(()) 21 | | }); | |______^ note: ...so that a type/lifetime parameter is in scope here --> $DIR/scope_callback_capture.rs:9:5 | 9 | / lua.scope(|scope| -> Result<()> { 10 | | let mut inner: Option
= None; 11 | | let f = scope 12 | | .create_function_mut(move |lua, t: Table| { ... | 20 | | Ok(()) 21 | | }); | |______^