1 // Test that we do not allow the region `'x` to escape in the impl
2 // trait **even though** `'y` escapes, which outlives `'x`.
4 // See https://github.com/rust-lang/rust/issues/46541 for more details.
12 impl<'a, 'b> Trait<'b> for Cell<&'a u32> { }
14 fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y>
18 //~^ ERROR hidden type for `impl Trait<'y>` captures lifetime that does not appear in bounds [E0700]