Skip to content

impl PartialEq<Vec<B>> for &[A], &mut [A]#71660

Merged
bors merged 2 commits intorust-lang:masterfrom
sollyucko:master
Jun 22, 2020
Merged

impl PartialEq<Vec<B>> for &[A], &mut [A]#71660
bors merged 2 commits intorust-lang:masterfrom
sollyucko:master

Conversation

@sollyucko
Copy link
Contributor

@sollyucko sollyucko commented Apr 29, 2020

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @withoutboats (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2020
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@jonas-schievink jonas-schievink added relnotes Marks issues that should be documented in the release notes of the next release. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 29, 2020
@jonas-schievink jonas-schievink added this to the 1.45 milestone Apr 29, 2020
@shepmaster
Copy link
Member

r? @kennytm

@marmeladema
Copy link
Contributor

I am definitely not a compiler-team member and I don't want to overstep any boundaries here, so I apologize in advance if I do, just let me know. But should this kind of change requires some tests?

@shepmaster
Copy link
Member

I would agree that some tests should be added, specifically those exercising the specific equality being added. Also, I’d have some assert_eq usages as this comes up as a common usage.

@kennytm
Copy link
Member

kennytm commented Apr 29, 2020

@shepmaster ya know I can't start the required FCP for this insta-stable PR since I'm not in the libs team 🙃

@shepmaster
Copy link
Member

ya know

I appreciate that you think I know anything. What I know is that you are a thorough reviewer (like one who realized that this would be insta-stable and thus needs a RFC).

@shepmaster
Copy link
Member

r? @LukasKalbertodt

@sollyucko sollyucko force-pushed the master branch 3 times, most recently from 70a4b90 to 1d93212 Compare April 29, 2020 14:30
Copy link
Member

@shepmaster shepmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "slice"s are not slices; that needs to be changed.

You don't have to follow this, but I would have written the tests to lean on the type checker more. Something like:

fn compare_vec_and_array(v: Vec<i32>, a: [i32; 3]) {
    let _ = v == a;
    let _ = a == v;

    assert_eq!(v, a);
    assert_eq!(a, v);
}

fn compare_vec_and_slice(v: Vec<i32>, s: &[i32]) { /* ... */ }

// Optionally make these take in `Vec<T>`?

I don't know if I would even call these functions; their existence proves that the traits exist. I might call them just to prove that they were compiled.

I also advocate for having smaller tests with better names. That way, when a test fails, you can tell what failed by the name, and it's easier to see what is being tested.

@sollyucko
Copy link
Contributor Author

I'm still keeping the mega-test for thoroughness, but I can remove it if you'd prefer.

@sollyucko

This comment has been minimized.

@sollyucko

This comment has been minimized.

@dtolnay
Copy link
Member

dtolnay commented Jun 20, 2020

I reverted 73194c527519565a686e8e79d9f81ed8374a1d07 because those impls were not included in the FCP proposal. There can be a separate FCP in a different PR.

@dtolnay
Copy link
Member

dtolnay commented Jun 20, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 20, 2020

📌 Commit 4896a06 has been approved by dtolnay

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 20, 2020
@dtolnay dtolnay modified the milestones: 1.45, 1.46 Jun 20, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 21, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 21, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 22, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 22, 2020
@bors
Copy link
Collaborator

bors commented Jun 22, 2020

⌛ Testing commit 4896a06 with merge 3de9e530d523ca4a2386e981b9e1cd89a6b9fa34...

@Dylan-DPC-zz
Copy link

included in rollup (accidentally two of them :P )

@bors retry

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 22, 2020
Rollup of 6 pull requests

Successful merges:

 - rust-lang#71660 (impl PartialEq<Vec<B>> for &[A], &mut [A])
 - rust-lang#72623 (Prefer accessible paths in 'use' suggestions)
 - rust-lang#73502 (Add E0765)
 - rust-lang#73580 (deprecate wrapping_offset_from)
 - rust-lang#73582 (Miri: replace many bug! by span_bug!)
 - rust-lang#73585 (Do not send a notification for P-high stable regressions)

Failed merges:

 - rust-lang#73581 (Create 0766 error code)

r? @ghost
@bors bors merged commit 8da1dd0 into rust-lang:master Jun 22, 2020
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jun 23, 2020
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. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.