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