1
1
error: lifetime may not live long enough
2
- --> $DIR/type-checking-test-4.rs:15 :13
2
+ --> $DIR/type-checking-test-4.rs:19 :13
3
3
|
4
4
LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
5
5
| -- lifetime `'a` defined here
6
6
LL | let _ = x as &dyn Bar<'static, 'a>; // Error
7
7
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
8
8
9
9
error: lifetime may not live long enough
10
- --> $DIR/type-checking-test-4.rs:20 :13
10
+ --> $DIR/type-checking-test-4.rs:24 :13
11
11
|
12
12
LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
13
13
| -- lifetime `'a` defined here
14
14
LL | let _ = x as &dyn Bar<'a, 'static>; // Error
15
15
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
16
16
17
17
error: lifetime may not live long enough
18
- --> $DIR/type-checking-test-4.rs:26 :5
18
+ --> $DIR/type-checking-test-4.rs:30 :5
19
19
|
20
20
LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
21
21
| -- lifetime `'a` defined here
@@ -24,23 +24,23 @@ LL | y.get_b() // ERROR
24
24
| ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
25
25
26
26
error: lifetime may not live long enough
27
- --> $DIR/type-checking-test-4.rs:31 :5
27
+ --> $DIR/type-checking-test-4.rs:35 :5
28
28
|
29
29
LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
30
30
| -- lifetime `'a` defined here
31
31
LL | <_ as Bar>::get_b(x) // ERROR
32
32
| ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
33
33
34
34
error: lifetime may not live long enough
35
- --> $DIR/type-checking-test-4.rs:36 :5
35
+ --> $DIR/type-checking-test-4.rs:40 :5
36
36
|
37
37
LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
38
38
| -- lifetime `'a` defined here
39
39
LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR
40
40
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
41
41
42
42
error: lifetime may not live long enough
43
- --> $DIR/type-checking-test-4.rs:44 :5
43
+ --> $DIR/type-checking-test-4.rs:48 :5
44
44
|
45
45
LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
46
46
| -- lifetime `'a` defined here
0 commit comments