Skip to content

[reverted] implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N] - #152972

Merged
rust-bors[bot] merged 5 commits into
rust-lang:mainfrom
iAeternus:fix-vecdeque-partialeq-symmetry
Sep 28, 2026
Merged

rust-bors[bot] merged 5 commits into
rust-lang:mainfrom
iAeternus:fix-vecdeque-partialeq-symmetry

Conversation

@iAeternus

@iAeternus iAeternus commented Feb 22, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

This PR is a response to #152830. It implement PartialEq<VecDeque> for Vec, &[T], &mut [T], [T; N] and &mut [T; N]. To be symmetrical with the standard library's __impl_slice_eq1, I added the __impl_slice_eq2 macro to generate the implementation. Additionally, I added the reverse equality unit test (test_partial_eq_vecdeque_reverse), modified too_generic_eval_ice.current.stderr, and passed the local tests.
This PR does not involve the comparison between Cow vs Vec and Cow vs &mut [T].
PS:
This is my first time participating in this project. If there are any mistakes, please feel free to correct me.

@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 Feb 22, 2026
@rustbot

rustbot commented Feb 22, 2026

Copy link
Copy Markdown
Collaborator

r? @joboet

rustbot has assigned @joboet.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, jhpratt, joboet

@rust-log-analyzer

This comment has been minimized.

@workingjubilee

Copy link
Copy Markdown
Member

...who says "corrigendum"? This isn't an academics paper, this is a PR. Your PR's description should be as succinct as you can make it, and written by hand in your own words. See https://forge.rust-lang.org/how-to-start-contributing.html#etiquette

@workingjubilee

Copy link
Copy Markdown
Member

This PR is already addressed by #149045

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 22, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 22, 2026
@workingjubilee

Copy link
Copy Markdown
Member

Wait, this isn't addressed by that, this is VecDeque not Vec.

@workingjubilee workingjubilee added T-libs-api [DEPRECATED; DO NOT USE] and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 22, 2026
@rust-log-analyzer

This comment has been minimized.

@joboet

joboet commented Feb 25, 2026

Copy link
Copy Markdown
Member

r? libs-api

This will need an FCP.

This is my first time participating in this project. If there are any mistakes, please feel free to correct me.

Welcome! As it stands, the PR description is very bloated and reads like the LLM-generated robot-speak that it is (if you read it through, every information is repeated twice). That comes across as quite rude; after all, why should anyone spend time on your work if you didn't invest your?

So please, write your contributions yourself. As far as I can tell from your profile, English isn't your first language (it isn't for me either). Using translation tools is completely fine, but please make sure that the generated output is close to what you had originally written. Try prompting the LLM to keep that in mind – context matters, even and especially for mindless stochastic parrots. And in the end, even the most nuanced prompt cannot and should not replace a manual review of the output.

@rustbot author
until then.

@rustbot rustbot assigned dtolnay and unassigned joboet Feb 25, 2026
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 25, 2026
@rustbot

rustbot commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@iAeternus

Copy link
Copy Markdown
Contributor Author

r? libs-api

This will need an FCP.

This is my first time participating in this project. If there are any mistakes, please feel free to correct me.

Welcome! As it stands, the PR description is very bloated and reads like the LLM-generated robot-speak that it is (if you read it through, every information is repeated twice). That comes across as quite rude; after all, why should anyone spend time on your work if you didn't invest your?

So please, write your contributions yourself. As far as I can tell from your profile, English isn't your first language (it isn't for me either). Using translation tools is completely fine, but please make sure that the generated output is close to what you had originally written. Try prompting the LLM to keep that in mind – context matters, even and especially for mindless stochastic parrots. And in the end, even the most nuanced prompt cannot and should not replace a manual review of the output.

@rustbot author until then.

Thank you for your suggestion. I have rewritten the PR description. From now on, I will describe the PR in my own words.

@iAeternus iAeternus changed the title alloc: make VecDeque partial equality symmetric with vec/slice/array implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N] and &mut [T; N] Feb 26, 2026
@iAeternus

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 26, 2026
@iAeternus

Copy link
Copy Markdown
Contributor Author

Starting a crater run to check if this breaks type inference in the ecosystem.

@bors try

@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@iAeternus: 🔑 Insufficient privileges: not in try users

@rust-log-analyzer

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor

(note: the error is because you are using the same stability attribute for the new and old impls. I think you might need to move the attribute to be part of the macro call instead to fix this)

@clarfonthey

Copy link
Copy Markdown
Contributor

So, decision here is that we're approaching past the point where things are useful once we go past Vec into VecDeque because the matrix of possibilities is just too big. There's a good table here that shows just how many types are involved, and it's not even complete.

But, with them, we are okay adding symmetric versions of existing impls if none of them break inference. If any break inference, we're planning to close. So, we'll wait on crater.

@clarfonthey clarfonthey removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Sep 22, 2026
@craterbot

Copy link
Copy Markdown
Collaborator

🚧 Experiment pr-152972 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

Copy link
Copy Markdown
Collaborator

🎉 Experiment pr-152972 is completed!
📊 0 regressed and 0 fixed (1124431 total)
📊 6141 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-152972/retry-regressed-list.txt ↩

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Sep 27, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

Crater is benevolent this time…

@rust-bors

rust-bors Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9942d36 has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 27, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 27, 2026
…ymmetry, r=clarfonthey

implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N]

This PR is a response to rust-lang#152830. It implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N] and &mut [T; N]. To be symmetrical with the standard library's __impl_slice_eq1, I added the __impl_slice_eq2 macro to generate the implementation. Additionally, I added the reverse equality unit test (test_partial_eq_vecdeque_reverse), modified too_generic_eval_ice.current.stderr, and passed the local tests.
This PR does not involve the comparison between Cow vs Vec and Cow vs &mut [T].
PS:
This is my first time participating in this project. If there are any mistakes, please feel free to correct me.
rust-bors Bot pushed a commit that referenced this pull request Sep 28, 2026
Rollup of 11 pull requests

Successful merges:

 - #163085 (Suggest similarly named modules in import paths)
 - #163098 ([debugger visualizers] Add workaround to read `Rc` strong/weak counts)
 - #163120 (ci: make musl.sh look for patches next to the script)
 - #163301 (Fix unused_must_use for scenario which may need to keep value)
 - #163307 (Less `SpanData` in diagnostics)
 - #152972 (implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N])
 - #162536 (Implement Default for NumBuffer)
 - #163141 (Document safety requirements for intrinsic fallbacks)
 - #163384 (Various clean-ups around `LayoutCalculator`)
 - #163405 (Remove some #[linkage] options)
 - #163413 (mailmap: add Matilde Morrone)
rust-bors Bot pushed a commit that referenced this pull request Sep 28, 2026
Rollup of 11 pull requests

Successful merges:

 - #163085 (Suggest similarly named modules in import paths)
 - #163098 ([debugger visualizers] Add workaround to read `Rc` strong/weak counts)
 - #163120 (ci: make musl.sh look for patches next to the script)
 - #163301 (Fix unused_must_use for scenario which may need to keep value)
 - #163307 (Less `SpanData` in diagnostics)
 - #163389 (`rustc_builtin_macros` cleanup, part 7)
 - #152972 (implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N])
 - #162536 (Implement Default for NumBuffer)
 - #163141 (Document safety requirements for intrinsic fallbacks)
 - #163384 (Various clean-ups around `LayoutCalculator`)
 - #163413 (mailmap: add Matilde Morrone)
@rust-bors
rust-bors Bot merged commit 3d54fac into rust-lang:main Sep 28, 2026
13 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Sep 28, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 28, 2026
Rollup merge of #152972 - iAeternus:fix-vecdeque-partialeq-symmetry, r=clarfonthey

implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N]

This PR is a response to #152830. It implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N] and &mut [T; N]. To be symmetrical with the standard library's __impl_slice_eq1, I added the __impl_slice_eq2 macro to generate the implementation. Additionally, I added the reverse equality unit test (test_partial_eq_vecdeque_reverse), modified too_generic_eval_ice.current.stderr, and passed the local tests.
This PR does not involve the comparison between Cow vs Vec and Cow vs &mut [T].
PS:
This is my first time participating in this project. If there are any mistakes, please feel free to correct me.
@iAeternus
iAeternus deleted the fix-vecdeque-partialeq-symmetry branch September 28, 2026 13:13
github-actions Bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Oct 1, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#163085 (Suggest similarly named modules in import paths)
 - rust-lang/rust#163098 ([debugger visualizers] Add workaround to read `Rc` strong/weak counts)
 - rust-lang/rust#163120 (ci: make musl.sh look for patches next to the script)
 - rust-lang/rust#163301 (Fix unused_must_use for scenario which may need to keep value)
 - rust-lang/rust#163307 (Less `SpanData` in diagnostics)
 - rust-lang/rust#163389 (`rustc_builtin_macros` cleanup, part 7)
 - rust-lang/rust#152972 (implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N])
 - rust-lang/rust#162536 (Implement Default for NumBuffer)
 - rust-lang/rust#163141 (Document safety requirements for intrinsic fallbacks)
 - rust-lang/rust#163384 (Various clean-ups around `LayoutCalculator`)
 - rust-lang/rust#163413 (mailmap: add Matilde Morrone)
@joboet

joboet commented Oct 4, 2026

Copy link
Copy Markdown
Member

So, decision here is that we're approaching past the point where things are useful once we go past Vec into VecDeque because the matrix of possibilities is just too big. There's a good table here that shows just how many types are involved, and it's not even complete.

But, with them, we are okay adding symmetric versions of existing impls if none of them break inference. If any break inference, we're planning to close. So, we'll wait on crater.

Shouldn't this still have gone through FCP? It's an instant-stable public API change, after all. It's probably fine to do retroactively...

@clarfonthey

Copy link
Copy Markdown
Contributor

Yes, I definitely just brain farted on that one ><

I'll revert so we can do a proper FCP.

@clarfonthey

Copy link
Copy Markdown
Contributor

Revert: #163752

@lcnr lcnr changed the title implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N] [reverted] implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N] Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants