Closed
Description
With RPIT, it is possible to create a "partial existential":
fn test1<A: Iterator<Item=&'static str>>(x: A)
-> Chain<A, impl Iterator<Item=&'static str>>
{
x.chain(once(","))
}
With TAIT, however, this currently produces an error:
type Chained<A> = Chain<A, impl Iterator<Item=&'static str>>;
fn test2<A: Iterator<Item=&'static str>>(x: A) -> Chained<A> {
x.chain(once(","))
}
This should probably be possible, both for concept parity for factoring unnamed RPIT out into named TAIT, and because this "partial existential" allows parameterizing partial existentials over input types in a way that allows input-type-dependent trait implementation.