// Regression test for #139004 use std::any::Any; type B = Box Fn(&(dyn Any + 'a)) -> Box>; fn foo() -> B { Box::new(|e| Box::new(e.is::())) //~^ ERROR the parameter type `E` may not live long enough } fn main() {}