-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Allow specifying multiple bounds for same associated item, except in trait objects #146593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
HIR ty lowering was modified cc @fmease |
This comment has been minimized.
This comment has been minimized.
Nobody knows what E0719 is when they're just scrolling by and reading the title, it's as if you put a GH issue number there; please make the title more descriptive. |
r? BoxyUwU |
Over in #143146, we had proposed FCP and then filed a concern related to @rfcbot fcp merge cc @rust-lang/types |
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
@rfcbot ping |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
☔ The latest upstream changes (presumably #146698) made this pull request unmergeable. Please resolve the merge conflicts. |
aec5ab4
to
389907a
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Supersedes #143146, fixes #143143.
This PR proposes to stop enforcing E0719 in all contexts other than trait object types.
E0719 forbids constraining the same associated item twice within the same angle-bracket delimited associated item bound list (the
…
insideT: Trait<…>
). For example, the following are forbidden:T: Trait<Gat<u32> = u32, Gat<u64> = u64>
T: Trait<Gat<u32> = u32> + Trait<Gat<u64> = u64>
T: Iterator<Item = u32, Item = i32>
T: Iterator<Item = u32> + Iterator<Item = i32>
(trivially false)T: Iterator<Item = u32, Item = u32>
T: Iterator<Item = u32>
T: Iterator<Item: Send, Item: Sync>
T: Iterator<Item: Send + Sync>
T: Trait<ASSOC = 3, ASSOC = 4>
T: Trait<ASSOC = 3> + Trait<ASSOC = 4>
(trivially false)T: Trait<ASSOC = 3, ASSOC = 3>
T: Trait<ASSOC = 3>
With this PR, all those previously forbidden examples would start working, as well as their APIT and RPIT equivalents.
Types like
dyn Iterator<Item = u32, Item = u32>
will continue to be rejected, however. See #143146 (comment) for the reason why.@rustbot label T-lang T-types needs-fcp