fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
835 B19 linesraw
1error: lifetime may not live long enough
2  --> $DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9
3   |
4LL |     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
9LL |         || 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
13help: consider adding 'move' keyword before the nested closure
14   |
15LL |         move || f() // The `nested` closure
16   |         ++++
17
18error: aborting due to previous error
19