pre-RFC: anonymous enums

I believe the "official" answer to that is Combinator to merge two futures yielding the same types · Pull Request #271 · rust-lang/futures-rs · GitHub "I'd prefer to keep the dependencies slim for now"

I've suggested more or less this on a few other threads, but with an explicit syntactic opt-in like "enum impl Trait" instead of just "impl Trait". I completely agree that it's not a complete solution to "anonymous enums" in general and if we ever did this it'd need some kind of opt-in since plain impl Trait generating an enum would, as you say, have non-zero overhead.

1 Like