Lieftime issue implementation of `Function` is not general enough

This:

impl<'a, Func, R, T> Function<'a, R, (T,)> for Func
where
    Func: Fn(T) -> R,
    R: FromReturn,
    T: IntoArg<'a>,

Is similar to here. For fn(&str) -> String aka for<'any> fn(&'any str) to meet this bound, it needs to be coerced into a fn(&'singular_lifetime str) -> String as &'any str is not a type (and T must be a singular type). [1]

You can maybe make it work using something along these lines, but also beware that inference really fell apart, and the size of code exploded, when I tried to adapt that approach to multiple parameters.


  1. From the T: IntoArg<'a> bound, we then get that the 'singular_lifetime must be 'a. ↩︎