1 error: lifetime may not live long enough
2 --> $DIR/closure-substs.rs:8:16
5 | -- lifetime `'a` defined here
8 | ^ returning this value requires that `'a` must outlive `'static`
10 = help: consider replacing `'a` with `'static`
12 error: lifetime may not live long enough
13 --> $DIR/closure-substs.rs:15:16
15 LL | |x: &i32| -> &'static i32 {
16 | - let's call the lifetime of this reference `'1`
18 | ^ returning this value requires that `'1` must outlive `'static`
20 error: lifetime may not live long enough
21 --> $DIR/closure-substs.rs:15:16
23 LL | |x: &i32| -> &'static i32 {
24 | - - let's call the lifetime of this reference `'2`
26 | let's call the lifetime of this reference `'1`
28 | ^ returning this value requires that `'1` must outlive `'2`
30 error: lifetime may not live long enough
31 --> $DIR/closure-substs.rs:22:9
34 | -- lifetime `'a` defined here
37 | ^^^^ argument requires that `'a` must outlive `'static`
39 = help: consider replacing `'a` with `'static`
41 error[E0521]: borrowed data escapes outside of closure
42 --> $DIR/closure-substs.rs:29:9
44 LL | |x: &i32, b: fn(&'static i32)| {
45 | - `x` is a reference that is only valid in the closure body
47 | ^^^^ `x` escapes the closure body here
49 error[E0521]: borrowed data escapes outside of closure
50 --> $DIR/closure-substs.rs:29:9
52 LL | |x: &i32, b: fn(&'static i32)| {
53 | - - `b` declared here, outside of the closure body
55 | `x` is a reference that is only valid in the closure body
57 | ^^^^ `x` escapes the closure body here
59 error: aborting due to 6 previous errors
61 For more information about this error, try `rustc --explain E0521`.