-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.