1+ warning: lifetime parameter `'b` never used
2+ --> $DIR/regions-static-bound.rs:3:17
3+ |
4+ LL | fn static_id<'a,'b>(t: &'a ()) -> &'static () where 'a: 'static { t }
5+ | -^^
6+ | |
7+ | help: elide the unused lifetime
8+ |
9+ note: the lint level is defined here
10+ --> $DIR/regions-static-bound.rs:1:9
11+ |
12+ LL | #![warn(unused_lifetimes)]
13+ | ^^^^^^^^^^^^^^^^
14+
115warning: unnecessary lifetime parameter `'a`
2- --> $DIR/regions-static-bound.rs:2:11
16+ --> $DIR/regions-static-bound.rs:3:53
317 |
4- LL | where 'a: 'static { t }
5- | ^^
18+ LL | fn static_id<'a,'b>(t: &'a ()) -> &'static () where 'a: 'static { t }
19+ | ^^
620 |
7- = note: `#[warn(named_static_lifetimes)]` on by default
821 = help: you can use the `'static` lifetime directly, in place of `'a`
922
1023warning: unnecessary lifetime parameter `'b`
11- --> $DIR/regions-static-bound.rs:6 :19
24+ --> $DIR/regions-static-bound.rs:8 :19
1225 |
1326LL | where 'a: 'b, 'b: 'static { t }
1427 | ^^
1528 |
1629 = help: you can use the `'static` lifetime directly, in place of `'b`
1730
1831error: lifetime may not live long enough
19- --> $DIR/regions-static-bound.rs:10 :5
32+ --> $DIR/regions-static-bound.rs:12 :5
2033 |
2134LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
2235 | -- lifetime `'a` defined here
2336LL | t
2437 | ^ returning this value requires that `'a` must outlive `'static`
2538
2639error[E0521]: borrowed data escapes outside of function
27- --> $DIR/regions-static-bound.rs:15 :5
40+ --> $DIR/regions-static-bound.rs:17 :5
2841 |
2942LL | fn error(u: &(), v: &()) {
3043 | - - let's call the lifetime of this reference `'1`
@@ -37,7 +50,7 @@ LL | static_id(&u);
3750 | argument requires that `'1` must outlive `'static`
3851
3952error[E0521]: borrowed data escapes outside of function
40- --> $DIR/regions-static-bound.rs:17 :5
53+ --> $DIR/regions-static-bound.rs:19 :5
4154 |
4255LL | fn error(u: &(), v: &()) {
4356 | - - let's call the lifetime of this reference `'2`
@@ -50,6 +63,6 @@ LL | static_id_indirect(&v);
5063 | `v` escapes the function body here
5164 | argument requires that `'2` must outlive `'static`
5265
53- error: aborting due to 3 previous errors; 2 warnings emitted
66+ error: aborting due to 3 previous errors; 3 warnings emitted
5467
5568For more information about this error, try `rustc --explain E0521`.
0 commit comments