diff options
Diffstat (limited to 'tests/compile/scope_callback_inner.stderr')
-rw-r--r-- | tests/compile/scope_callback_inner.stderr | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/compile/scope_callback_inner.stderr b/tests/compile/scope_callback_inner.stderr new file mode 100644 index 0000000..1c5f3b5 --- /dev/null +++ b/tests/compile/scope_callback_inner.stderr @@ -0,0 +1,45 @@ +error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements + --> $DIR/scope_callback_inner.rs:8:14 + | +8 | .create_function_mut(|_, t: Table| { + | ^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 5:15... + --> $DIR/scope_callback_inner.rs:5:15 + | +5 | lua.scope(|scope| { + | _______________^ +6 | | let mut inner: Option<Table> = None; +7 | | let f = scope +8 | | .create_function_mut(|_, t: Table| { +... | +13 | | Ok(()) +14 | | }); + | |_____^ +note: ...so that reference does not outlive borrowed content + --> $DIR/scope_callback_inner.rs:7:17 + | +7 | let f = scope + | ^^^^^ +note: but, the lifetime must be valid for the method call at 5:5... + --> $DIR/scope_callback_inner.rs:5:5 + | +5 | / lua.scope(|scope| { +6 | | let mut inner: Option<Table> = None; +7 | | let f = scope +8 | | .create_function_mut(|_, t: Table| { +... | +13 | | Ok(()) +14 | | }); + | |______^ +note: ...so that a type/lifetime parameter is in scope here + --> $DIR/scope_callback_inner.rs:5:5 + | +5 | / lua.scope(|scope| { +6 | | let mut inner: Option<Table> = None; +7 | | let f = scope +8 | | .create_function_mut(|_, t: Table| { +... | +13 | | Ok(()) +14 | | }); + | |______^ |