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
+
1
15
warning: unnecessary lifetime parameter `'a`
2
- --> $DIR/regions-static-bound.rs:2:11
16
+ --> $DIR/regions-static-bound.rs:3:53
3
17
|
4
- LL | where 'a: 'static { t }
5
- | ^^
18
+ LL | fn static_id<'a,'b>(t: &'a ()) -> &'static () where 'a: 'static { t }
19
+ | ^^
6
20
|
7
- = note: `#[warn(named_static_lifetimes)]` on by default
8
21
= help: you can use the `'static` lifetime directly, in place of `'a`
9
22
10
23
warning: unnecessary lifetime parameter `'b`
11
- --> $DIR/regions-static-bound.rs:6 :19
24
+ --> $DIR/regions-static-bound.rs:8 :19
12
25
|
13
26
LL | where 'a: 'b, 'b: 'static { t }
14
27
| ^^
15
28
|
16
29
= help: you can use the `'static` lifetime directly, in place of `'b`
17
30
18
31
error: lifetime may not live long enough
19
- --> $DIR/regions-static-bound.rs:10 :5
32
+ --> $DIR/regions-static-bound.rs:12 :5
20
33
|
21
34
LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
22
35
| -- lifetime `'a` defined here
23
36
LL | t
24
37
| ^ returning this value requires that `'a` must outlive `'static`
25
38
26
39
error[E0521]: borrowed data escapes outside of function
27
- --> $DIR/regions-static-bound.rs:15 :5
40
+ --> $DIR/regions-static-bound.rs:17 :5
28
41
|
29
42
LL | fn error(u: &(), v: &()) {
30
43
| - - let's call the lifetime of this reference `'1`
@@ -37,7 +50,7 @@ LL | static_id(&u);
37
50
| argument requires that `'1` must outlive `'static`
38
51
39
52
error[E0521]: borrowed data escapes outside of function
40
- --> $DIR/regions-static-bound.rs:17 :5
53
+ --> $DIR/regions-static-bound.rs:19 :5
41
54
|
42
55
LL | fn error(u: &(), v: &()) {
43
56
| - - let's call the lifetime of this reference `'2`
@@ -50,6 +63,6 @@ LL | static_id_indirect(&v);
50
63
| `v` escapes the function body here
51
64
| argument requires that `'2` must outlive `'static`
52
65
53
- error: aborting due to 3 previous errors; 2 warnings emitted
66
+ error: aborting due to 3 previous errors; 3 warnings emitted
54
67
55
68
For more information about this error, try `rustc --explain E0521`.
0 commit comments