//@ known-bug: #122704 use std::any::Any; pub struct Foo { bar: Box Fn(&'a usize) -> Box>, } impl Foo { pub fn ack(&mut self, f: impl for<'a> Fn(&'a usize) -> Box) { self.bar = Box::new(|baz| Box::new(f(baz))); } } fn main() {}