Skip to content

Conversation

joboet
Copy link
Member

@joboet joboet commented Mar 21, 2025

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-optimized Extend implementations of the individual collection.

@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 21, 2025
@rust-log-analyzer

This comment has been minimized.

joboet and others added 2 commits March 21, 2025 21:01
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`.
@joboet
Copy link
Member Author

joboet commented Sep 18, 2025

r? libs

@rustbot rustbot assigned Mark-Simulacrum and unassigned Amanieu Sep 18, 2025
@Mark-Simulacrum
Copy link
Member

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.

@joboet
Copy link
Member Author

joboet commented Sep 22, 2025

No, as far as I know this changes the behaviour. So yeah, an FCP seems warranted.
@rustbot label +I-libs-nominated

@rustbot rustbot added the I-libs-nominated Nominated for discussion during a libs team meeting. label Sep 22, 2025
@Amanieu
Copy link
Member

Amanieu commented Sep 24, 2025

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

@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Sep 24, 2025

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.

@Amanieu Amanieu removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Sep 24, 2025
@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Sep 24, 2025
@rust-rfcbot
Copy link
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot rust-rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Sep 24, 2025
@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 4, 2025
@rust-rfcbot
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants