@@ -7,32 +7,52 @@ LL | fn assert_static<'a: 'static>() {}
7
7
= help: you can use the `'static` lifetime directly, in place of `'a`
8
8
9
9
warning: unnecessary lifetime parameter `'a`
10
- --> $DIR/implied_lifetime_wf_check3.rs:14 :22
10
+ --> $DIR/implied_lifetime_wf_check3.rs:15 :22
11
11
|
12
12
LL | fn assert_static<'a: 'static>() {}
13
13
| ^^
14
14
|
15
15
= help: you can use the `'static` lifetime directly, in place of `'a`
16
16
17
17
warning: unnecessary lifetime parameter `'a`
18
- --> $DIR/implied_lifetime_wf_check3.rs:20 :22
18
+ --> $DIR/implied_lifetime_wf_check3.rs:22 :22
19
19
|
20
20
LL | fn assert_static<'a: 'static>() {}
21
21
| ^^
22
22
|
23
23
= help: you can use the `'static` lifetime directly, in place of `'a`
24
24
25
+ error: lifetime may not live long enough
26
+ --> $DIR/implied_lifetime_wf_check3.rs:8:43
27
+ |
28
+ LL | fn test<'a>() where Ty<'a>: 'static { assert_static::<'a>() }
29
+ | -- lifetime `'a` defined here ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
30
+
31
+ error: lifetime may not live long enough
32
+ --> $DIR/implied_lifetime_wf_check3.rs:17:46
33
+ |
34
+ LL | fn test<'a>() where for<'b> Ty<'b>: 'a { assert_static::<'a>() }
35
+ | -- lifetime `'a` defined here ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
36
+
37
+ error: lifetime may not live long enough
38
+ --> $DIR/implied_lifetime_wf_check3.rs:24:21
39
+ |
40
+ LL | fn test<'a>() { assert_static::<'a>() }
41
+ | -- ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
42
+ | |
43
+ | lifetime `'a` defined here
44
+
25
45
error[E0310]: the parameter type `A` may not live long enough
26
- --> $DIR/implied_lifetime_wf_check3.rs:35:18
46
+ --> $DIR/implied_lifetime_wf_check3.rs:32:41
27
47
|
28
- LL | type Ty <A> = impl Sized + 'static;
29
- | ^^ ^^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
48
+ LL | fn test <A>() where Ty<A>: 'static { assert_static::<A>() }
49
+ | ^^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
30
50
|
31
51
help: consider adding an explicit lifetime bound...
32
52
|
33
- LL | type Ty <A: 'static> = impl Sized + 'static;
53
+ LL | fn test <A: 'static>() where Ty<A>: 'static { assert_static::<A>() }
34
54
| +++++++++
35
55
36
- error: aborting due to previous error ; 3 warnings emitted
56
+ error: aborting due to 4 previous errors ; 3 warnings emitted
37
57
38
58
For more information about this error, try `rustc --explain E0310`.
0 commit comments