I’m currently writing a function with following signature:
fn get_post<F: FnOnce(&Document) -> Vec<(&'static str, String)> + 'static>( ... params ... form_data: F, ) -> impl Future<Item = (... results ...), Error = Error> + 'static
The problem is that, if I omit the
'static bound on return value, it fails to compile (with a infamously unhelpful error message).
-> impl Future<Item = (...), Error = Error> doesn’t work because there’s no default bound, while
-> Box<Future<Item = (...), Error = Error>> automatically adds the
'static bound for me.
Is this intended, or should I file a bug?