Lifetime doesn't survive type mapping

So I was writing an article on metaprogramming and noticed the compiler isn't able to properly infer transformed types when the transformation contains a lifetime. I've reduced the example to 50 loc: lifetime.rs · GitHub

Basically I'm trying to write a mapping trait that turns a tuple representing a list of types into another tuple containing a list of mapping results.

The lifetime.rs version in the linked gist fails to compile while the discrete_type.rs version works just fine. I'm wondering whether this is a compiler bug I should report or I'm missing something about lifetimes.
Both versions are identical except in lifetime.rs ToHandler<'s> takes a lifetime (and does nothing with it), and in discrete_type.rs ToHandler<T> takes a type (and uses it).

The terms/jargon applicable here is the the compiler fails to normalize the trait projection (associated type in a particular trait implementation) when there's a lifetime involved in some particular way.

There's a number of normalization issues in the repo (and it's a pain to search on mobile); perhaps it's this one (or perhaps there's a more relevant one):

2 Likes

I further reduced the example further and added it to an issue I found matches my example best.

Thanks for informing me on appropriate terms to use to describe my problem, that helped a lot with tracking the issue down.