11error: lifetime may not live long enough
2- --> $DIR/type-checking-test-4.rs:15 :13
2+ --> $DIR/type-checking-test-4.rs:19 :13
33 |
44LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
55 | -- lifetime `'a` defined here
66LL | let _ = x as &dyn Bar<'static, 'a>; // Error
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
88
99error: lifetime may not live long enough
10- --> $DIR/type-checking-test-4.rs:20 :13
10+ --> $DIR/type-checking-test-4.rs:24 :13
1111 |
1212LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
1313 | -- lifetime `'a` defined here
1414LL | let _ = x as &dyn Bar<'a, 'static>; // Error
1515 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
1616
1717error: lifetime may not live long enough
18- --> $DIR/type-checking-test-4.rs:26 :5
18+ --> $DIR/type-checking-test-4.rs:30 :5
1919 |
2020LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
2121 | -- lifetime `'a` defined here
@@ -24,23 +24,23 @@ LL | y.get_b() // ERROR
2424 | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
2525
2626error: lifetime may not live long enough
27- --> $DIR/type-checking-test-4.rs:31 :5
27+ --> $DIR/type-checking-test-4.rs:35 :5
2828 |
2929LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
3030 | -- lifetime `'a` defined here
3131LL | <_ as Bar>::get_b(x) // ERROR
3232 | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
3333
3434error: lifetime may not live long enough
35- --> $DIR/type-checking-test-4.rs:36 :5
35+ --> $DIR/type-checking-test-4.rs:40 :5
3636 |
3737LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
3838 | -- lifetime `'a` defined here
3939LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR
4040 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
4141
4242error: lifetime may not live long enough
43- --> $DIR/type-checking-test-4.rs:44 :5
43+ --> $DIR/type-checking-test-4.rs:48 :5
4444 |
4545LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
4646 | -- lifetime `'a` defined here
0 commit comments