1 trait Dummy { fn dummy(&self); }
3 fn foo1
<'a
:'b
,'b
>(x
: &'a
mut (dyn Dummy
+'a
)) -> &'b
mut (dyn Dummy
+'b
) {
4 // Here, we are able to coerce
8 fn foo2
<'a
:'b
,'b
>(x
: &'b
mut (dyn Dummy
+'a
)) -> &'b
mut (dyn Dummy
+'b
) {
9 // Here, we are able to coerce
13 fn foo3
<'a
,'b
>(x
: &'a
mut dyn Dummy
) -> &'b
mut dyn Dummy
{
14 // Without knowing 'a:'b, we can't coerce
15 x
//~ ERROR lifetime bound not satisfied
16 //~^ ERROR cannot infer an appropriate lifetime
20 fn foo4
<'a
:'b
,'b
>(x
: Wrapper
<&'a
mut dyn Dummy
>) -> Wrapper
<&'b
mut dyn Dummy
> {
21 // We can't coerce because it is packed in `Wrapper`
22 x
//~ ERROR mismatched types