]>
Commit | Line | Data |
---|---|---|
923072b8 FG |
1 | error: lifetime may not live long enough |
2 | --> $DIR/type-checking-test-3.rs:12:13 | |
94222f64 XL |
3 | | |
4 | LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) { | |
923072b8 FG |
5 | | -- lifetime `'a` defined here |
6 | LL | let _ = x as &dyn Bar<'a>; // Error | |
7 | | ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` | |
94222f64 | 8 | |
923072b8 FG |
9 | error: lifetime may not live long enough |
10 | --> $DIR/type-checking-test-3.rs:17:13 | |
94222f64 XL |
11 | | |
12 | LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) { | |
923072b8 FG |
13 | | -- lifetime `'a` defined here |
14 | LL | let _ = x as &dyn Bar<'static>; // Error | |
15 | | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` | |
94222f64 XL |
16 | |
17 | error: aborting due to 2 previous errors | |
18 |