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.
7 #![feature(in_band_lifetimes)]
13 impl Trait<'b> for Cell<&'a u32> { }
15 fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
19 //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]