-
Notifications
You must be signed in to change notification settings - Fork 13.8k
core: simplify Extend
for tuples
#138799
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?
core: simplify Extend
for tuples
#138799
Conversation
This comment has been minimized.
This comment has been minimized.
This is an alternative to rust-lang#137400. The current macro is incredibly complicated and introduces subtle bugs like calling the `extend_one` of the individual collections in backwards order. This PR drastically simplifies the macro by removing recursion and moving the specialization out of the macro. It also fixes the ordering issue described above (I've stolen the test of the new behaviour from rust-lang#137400). Additionally, the 1-tuple is now special-cased to allow taking advantage of the well-optimized `Extend` implementations of the individual collection.
ordering of side-effects to `coretest`.
r? libs |
Did we land the behavior fix (extend_one mentioned in the PR description) already? Or is this a behavior change that needs cratering / FCP / etc? The implementation itself does seem like a good simplification but presumably we'd want FCP for the behavior fix. |
No, as far as I know this changes the behaviour. So yeah, an FCP seems warranted. |
We discussed this in the @rust-lang/libs meeting and we're happy with the behavior changes. We consider the 2 changes listed in #137400 (comment) to be implementation-defined behavior that was never guaranteed in the documentation. @rfcbot merge |
Team member @Amanieu 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! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
This is an alternative to #137400. The current macro is incredibly complicated and introduces subtle bugs like calling the
extend_one
of the individual collections in backwards order. This PR drastically simplifies the macro by removing recursion and moving the specialization out of the macro. It also fixes the ordering issue described above (I've stolen the test of the new behaviour from #137400). Additionally, the 1-tuple is now special-cased to allow taking advantage of the well-optimizedExtend
implementations of the individual collection.