1 error: lifetime may not live long enough
2 --> $DIR/regions-trait-object-subtyping.rs:15:5
4 LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
5 | -- -- lifetime `'b` defined here
7 | lifetime `'a` defined here
8 LL | // Without knowing 'a:'b, we can't coerce
10 | ^ returning this value requires that `'a` must outlive `'b`
12 = help: consider adding the following bound: `'a: 'b`
13 = note: requirement occurs because of a mutable reference to dyn Dummy
14 = note: mutable references are invariant over their type parameter
15 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
17 error: lifetime may not live long enough
18 --> $DIR/regions-trait-object-subtyping.rs:22:5
20 LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dummy> {
21 | -- -- lifetime `'b` defined here
23 | lifetime `'a` defined here
24 LL | // We can't coerce because it is packed in `Wrapper`
26 | ^ returning this value requires that `'b` must outlive `'a`
28 = help: consider adding the following bound: `'b: 'a`
29 = note: requirement occurs because of a mutable reference to dyn Dummy
30 = note: mutable references are invariant over their type parameter
31 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
33 error: aborting due to 2 previous errors