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
16 //~^ ERROR lifetime may not live long enough
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`
23 //~^ ERROR lifetime may not live long enough