]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-trait-object-subtyping.nll.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / regions / regions-trait-object-subtyping.nll.stderr
1 error: unsatisfied lifetime constraints
2   --> $DIR/regions-trait-object-subtyping.rs:25:5
3    |
4 LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy {
5    |         -- -- lifetime `'b` defined here
6    |         |
7    |         lifetime `'a` defined here
8 LL |     // Without knowing 'a:'b, we can't coerce
9 LL |     x //~ ERROR lifetime bound not satisfied
10    |     ^ cast requires that `'a` must outlive `'b`
11
12 error: unsatisfied lifetime constraints
13   --> $DIR/regions-trait-object-subtyping.rs:32:5
14    |
15 LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> {
16    |         --    -- lifetime `'b` defined here
17    |         |
18    |         lifetime `'a` defined here
19 LL |     // We can't coerce because it is packed in `Wrapper`
20 LL |     x //~ ERROR mismatched types
21    |     ^ returning this value requires that `'b` must outlive `'a`
22
23 error: aborting due to 2 previous errors
24