]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/user-annotations/closure-substs.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / nll / user-annotations / closure-substs.stderr
CommitLineData
9fa01778 1error: lifetime may not live long enough
0731742a 2 --> $DIR/closure-substs.rs:8:16
0bf4aa26
XL
3 |
4LL | fn foo<'a>() {
5 | -- lifetime `'a` defined here
6...
532ac7d7 7LL | return x;
0bf4aa26 8 | ^ returning this value requires that `'a` must outlive `'static`
60c5eb7d
XL
9 |
10 = help: consider replacing `'a` with `'static`
0bf4aa26 11
9fa01778 12error: lifetime may not live long enough
0731742a 13 --> $DIR/closure-substs.rs:15:16
0bf4aa26
XL
14 |
15LL | |x: &i32| -> &'static i32 {
16 | - let's call the lifetime of this reference `'1`
532ac7d7 17LL | return x;
0bf4aa26
XL
18 | ^ returning this value requires that `'1` must outlive `'static`
19
9fa01778 20error: lifetime may not live long enough
0731742a 21 --> $DIR/closure-substs.rs:22:9
0bf4aa26
XL
22 |
23LL | fn bar<'a>() {
24 | -- lifetime `'a` defined here
25...
532ac7d7 26LL | b(x);
0bf4aa26 27 | ^^^^ argument requires that `'a` must outlive `'static`
60c5eb7d
XL
28 |
29 = help: consider replacing `'a` with `'static`
0bf4aa26
XL
30
31error[E0521]: borrowed data escapes outside of closure
0731742a 32 --> $DIR/closure-substs.rs:29:9
0bf4aa26
XL
33 |
34LL | |x: &i32, b: fn(&'static i32)| {
35 | - `x` is a reference that is only valid in the closure body
532ac7d7 36LL | b(x);
0bf4aa26
XL
37 | ^^^^ `x` escapes the closure body here
38
39error: aborting due to 4 previous errors
40