-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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.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 RFCE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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.WG-traits[RETIRED] Working group: Traits[RETIRED] Working group: Traits
Description
(Part of #34511)
As part of the latest impl Trait
RFC, we decided to accept impl Trait
in argument position:
fn foo(x: impl Iterator<Item = u32>) {
...
}
this is roughly equivalent to fn foo<T: Iterator<Item = u32>>(t: T)
, except that explicitly specifying the type is not permitted (i.e., foo::<u32>
is an error).
Mentoring instructions can be found here.
Questions to resolve:
- Should we permit specifying types if some parameters are implicit and some are explicit? e.g.,
fn foo<T>(x: impl Iterator<Item = T>>)
? I think yes,foo::<u32>
would be accepted (thus bindingT = u32
explicitly).- Answer: for now, just forbid explicit bindings altogether in the presence of
impl Trait
arguments.
- Answer: for now, just forbid explicit bindings altogether in the presence of
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.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 RFCE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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.WG-traits[RETIRED] Working group: Traits[RETIRED] Working group: Traits