]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / traits / trait-upcasting / type-checking-test-4.stderr
CommitLineData
923072b8 1error: lifetime may not live long enough
487cf647 2 --> $DIR/type-checking-test-4.rs:15:13
94222f64
XL
3 |
4LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
923072b8
FG
5 | -- lifetime `'a` defined here
6LL | let _ = x as &dyn Bar<'static, 'a>; // Error
7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
94222f64 8
923072b8 9error: lifetime may not live long enough
487cf647 10 --> $DIR/type-checking-test-4.rs:20:13
94222f64
XL
11 |
12LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
923072b8
FG
13 | -- lifetime `'a` defined here
14LL | let _ = x as &dyn Bar<'a, 'static>; // Error
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
94222f64 16
923072b8 17error: lifetime may not live long enough
487cf647 18 --> $DIR/type-checking-test-4.rs:26:5
94222f64
XL
19 |
20LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
923072b8 21 | -- lifetime `'a` defined here
94222f64 22LL | let y = x as &dyn Bar<'_, '_>;
a2a8927a 23LL | y.get_b() // ERROR
923072b8 24 | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
a2a8927a 25
923072b8 26error: lifetime may not live long enough
487cf647 27 --> $DIR/type-checking-test-4.rs:31:5
a2a8927a
XL
28 |
29LL | fn test_wrong4<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
923072b8 30 | -- lifetime `'a` defined here
a2a8927a 31LL | <_ as Bar>::get_b(x) // ERROR
923072b8 32 | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
a2a8927a 33
923072b8 34error: lifetime may not live long enough
487cf647 35 --> $DIR/type-checking-test-4.rs:36:5
a2a8927a
XL
36 |
37LL | fn test_wrong5<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
923072b8 38 | -- lifetime `'a` defined here
a2a8927a 39LL | <_ as Bar<'_, '_>>::get_b(x) // ERROR
923072b8 40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
a2a8927a 41
923072b8 42error: lifetime may not live long enough
487cf647 43 --> $DIR/type-checking-test-4.rs:44:5
a2a8927a
XL
44 |
45LL | fn test_wrong6<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
923072b8 46 | -- lifetime `'a` defined here
a2a8927a
XL
47...
48LL | z.get_b() // ERROR
923072b8 49 | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
94222f64 50
a2a8927a 51error: aborting due to 6 previous errors
94222f64 52