// Test for what happens when a type parameter `A` is closed over into // an object. This should yield errors unless `A` (and the object) // both have suitable bounds. trait SomeTrait { fn get(&self) -> isize; } fn make_object1(v: A) -> Box { Box::new(v) as Box //~^ ERROR the parameter type `A` may not live long enough } fn make_object2<'a, A: SomeTrait + 'a>(v: A) -> Box { Box::new(v) as Box } fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box { Box::new(v) as Box //~^ ERROR the parameter type `A` may not live long enough } fn main() {}