// Check that we correctly infer that b and c must be region // parameterized because they reference a which requires a region. type A<'a> = &'a isize; type B<'a> = Box>; struct C<'a> { f: Box> } trait SetF<'a> { fn set_f_ok(&mut self, b: Box>); fn set_f_bad(&mut self, b: Box); } impl<'a> SetF<'a> for C<'a> { fn set_f_ok(&mut self, b: Box>) { self.f = b; } fn set_f_bad(&mut self, b: Box) { self.f = b; //~^ ERROR lifetime may not live long enough } } fn main() {}