]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / issue-53432-nested-closure-outlives-borrowed-value.stderr
1 error: lifetime may not live long enough
2   --> $DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9
3    |
4 LL |     let _action = move || {
5    |                   -------
6    |                   |     |
7    |                   |     return type of closure `[closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:11]` contains a lifetime `'2`
8    |                   lifetime `'1` represents this closure's body
9 LL |         || f() // The `nested` closure
10    |         ^^^^^^ returning this value requires that `'1` must outlive `'2`
11    |
12    = note: closure implements `Fn`, so references to captured variables can't escape the closure
13 help: consider adding 'move' keyword before the nested closure
14    |
15 LL |         move || f() // The `nested` closure
16    |         ++++
17
18 error: aborting due to previous error
19