Would it ever be possible to write an HRTB for a type whose lifetime variables' names' you don't know? That is, something like for<any lifetimes included in T> fn(T) -> u32?
Motivation
I'm the author of Mockall, a popular mocking library. In order to mock generic methods, Mockall needs to store a completion function as a Box<Any>, and later downcast it to a concrete form. Mockall does not need to downcast the method's generic types; just a Fn object that accepts or returns those types. There is no reason why the completion function can't be 'static; Mockall already handles functions with reference arguments by adding an appropriate HRTB. The problem is that for non-static types more complicated than a reference, Mockall doesn't know what the lifetime arguments are.
One solution would be to allow TypeId for non-'static types. But that dead horse has been beaten enough. My request is simpler. Would it be possible to define an HRTB for every lifetime contained in a given type?
A way of accomplishing something similar is just T: 'a, which requires T to be valid for (at least) 'a. This, in turn, means any lifetime parameters in T must outlive 'a.
If this isn't what you want, it'd be good to clarify further.
Yea, it would be great to be able to add constraints involving higher ranked parameters, but currently that's not possible in Rust. I don't remember if this is something that would be tractable with chalk or if it presents other problems.