}
impl<T, F: 'static> ClonableFn<T> for F
-where F: Fn(T) + Clone {
+where
+ F: Fn(T) + Clone,
+{
fn clone(&self) -> Box<dyn Fn(T)> {
Box::new(self.clone())
}
struct Foo(Box<dyn for<'a> ClonableFn<&'a bool>>);
fn main() {
- Foo(Box::new(|_| ())); //~ ERROR mismatched types
+ Foo(Box::new(|_| ())); //~ ERROR implementation of `FnOnce` is not general enough
}