Any future plans for impl for multiple types?

In particular, it's asking for ad hoc name resolution, where the names are resolved as though instantiated through a macro.

Parts of template substitution I've expressed openness to considering before. For example, it might be ok to allow instantiation-time errors for things like fn foo<const N: usize>() -> [u8; N * 2]; -- after all, you already get instantiation-time errors with fn foo<const N: usize>() -> [u16; N]; on stable.

But anything like The Dreaded Two-Phase Name Lookup - The LLVM Project Blog I'd draw a hard line. I think it's important that macro-like name resolution be restricted to macros only. No adhoc extension points; only the principled ones that traits offer.

Macros aren't bogey-men. They should be avoided where a function works fine, but for something like this where you want token-expansion behaviour, no need to reduce the use of them.

4 Likes