-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for explicit_generic_args_with_impl_trait #83701
Copy link
Copy link
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.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
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.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.
This is a tracking issue for the
explicit_generic_args_with_impl_traitfeature gate.There has not been an RFC for this.
Steps
explicit_generic_args_with_impl_traitfeature gate #86176)Unresolved Questions
We should add a bit extra info when there are extra generic args andimpl Trait(see Implement aexplicit_generic_args_with_impl_traitfeature gate #86176 (comment))Implementation history
explicit_generic_args_with_impl_traitfeature gate #86176Background
Currently you cannot specify explicit generic arguments if a function uses
impl Traitanywhere its arguments. This is pretty annoying because it heavily restricts what kind of code you can write with functions that useimpl Traitcompared to what is possible with explicit generics.This difference between
impl Traitand explicit is in my opinion very unintuitive, it feels like you should be able to use them together. It is even mentioned as something in the original tracking issue forimpl Trait(#44721) that this would be desirable behaviour, but that there was a decision to hold off for the time being. That issue has been closed for long time, and there hasn't been any follow up as far as I can tell. So I'm opening up a new issue to discuss the feature and hopefully track adding it to the rust compiler.Examples
Related Issues
impl Traitand explicit generic arguments #71869