-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking issue for impl Trait (RFC 1522, RFC 1951, RFC 2071) #34511
Copy link
Copy link
Closed
Labels
B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Metadata
Metadata
Assignees
Labels
B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
NEW TRACKING ISSUE = #63066
Implementation status
The basic feature as specified in RFC 1522 is implemented, however there have been revisions that are still in need of work:
impl Traitrequires a named lifetime #49287impl TraitLifetime Elision #43396let x: impl Traitstaticandconst T: impl Traitabstract typeRFCs
There have been a number of RFCs regarding impl trait, all of which are tracked by this central tracking issue.
impl Traitrfcs#1522impl Trait, while expanding it to arguments rfcs#1951abstract typein modules and implsMyTrait<AssociatedType: Bounds>rfcs#2289 to match that syntax if that RFC gets merged.let,const, andstaticpositionsimpl Traitanddyn Traitwith multiple bounds rfcs#2250impl Traitanddyn Traitwith multiple boundsUnresolved questions
The implementation has raised a number of interesting questions as well:
implkeyword when parsing types? Discussion: 1Sendforwhere F: Fn() -> impl Foo + Send?impl Traitanddyn Traitwith multiple bounds rfcs#2250.+inimpl Trait/dyn Trait#45294impl Traitafter->infntypes or parentheses sugar? [impl Trait] Should we allowimpl Traitafter->infntypes or parentheses sugar? #45994fn foo<T>(x: impl Iterator<Item = T>>)?impl Traitas arguments in the list, permitting migrationexistential type Foo: Barortype Foo = impl Bar? (see here for discussion)existential typein an impl be just items of the impl, or include nested items within the impl functions etc? (see here for example)