]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/trait-upcasting/type-checking-test-3.stderr
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / traits / trait-upcasting / type-checking-test-3.stderr
1 error: lifetime may not live long enough
2   --> $DIR/type-checking-test-3.rs:11:13
3    |
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<'a>; // Error
7    |             ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
8
9 error: lifetime may not live long enough
10   --> $DIR/type-checking-test-3.rs:16:13
11    |
12 LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) {
13    |                -- lifetime `'a` defined here
14 LL |     let _ = x as &dyn Bar<'static>; // Error
15    |             ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
16
17 error: aborting due to 2 previous errors
18