1 warning: unnecessary lifetime parameter `'a`
2 --> $DIR/regions-static-bound.rs:2:11
4 LL | where 'a: 'static { t }
7 = help: you can use the `'static` lifetime directly, in place of `'a`
9 warning: unnecessary lifetime parameter `'b`
10 --> $DIR/regions-static-bound.rs:6:19
12 LL | where 'a: 'b, 'b: 'static { t }
15 = help: you can use the `'static` lifetime directly, in place of `'b`
17 error: lifetime may not live long enough
18 --> $DIR/regions-static-bound.rs:10:5
20 LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
21 | -- lifetime `'a` defined here
23 | ^ returning this value requires that `'a` must outlive `'static`
25 error[E0521]: borrowed data escapes outside of function
26 --> $DIR/regions-static-bound.rs:15:5
28 LL | fn error(u: &(), v: &()) {
29 | - - let's call the lifetime of this reference `'1`
31 | `u` is a reference that is only valid in the function body
35 | `u` escapes the function body here
36 | argument requires that `'1` must outlive `'static`
38 error[E0521]: borrowed data escapes outside of function
39 --> $DIR/regions-static-bound.rs:17:5
41 LL | fn error(u: &(), v: &()) {
42 | - - let's call the lifetime of this reference `'2`
44 | `v` is a reference that is only valid in the function body
46 LL | static_id_indirect(&v);
47 | ^^^^^^^^^^^^^^^^^^^^^^
49 | `v` escapes the function body here
50 | argument requires that `'2` must outlive `'static`
52 error: aborting due to 3 previous errors; 2 warnings emitted
54 For more information about this error, try `rustc --explain E0521`.