-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make vec::Drain and binary_heap::Drain covariant #34951
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. |
Thanks for the PR! Alas, there are a few issues that need to be resolved before we can merge it:
If the libs team decides that making these types covariant is worthwhile, the change will likely just involve using alternate types for |
Okay, fixed it. It's now basically the same as the original code, but with different types. |
@bors r+ |
📌 Commit d1e2a93 has been approved by |
⌛ Testing commit d1e2a93 with merge 24143b9... |
💔 Test failed - auto-win-gnu-32-opt |
@bors: retry On Mon, Jul 25, 2016 at 3:03 PM, bors notifications@github.com wrote:
|
@alexcrichton How do I interpret the error log from the build? The log seems to imply the error was in building llvm, but my changes did not touch llvm. |
@tomgarcia There's nothing wrong with this PR, @bors is just having some problems at the moment and will retry this PR at some point (thats what the |
Okay, thanks. |
⌛ Testing commit d1e2a93 with merge cb23f63... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors: retry On Tue, Jul 26, 2016 at 3:29 AM, bors notifications@github.com wrote:
|
Make vec::Drain and binary_heap::Drain covariant I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?
Make vec::Drain and binary_heap::Drain covariant I removed all mutable pointers/references, and added covariance tests similar to the ones in rust-lang#32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?
@tomgarcia Any interest in making a similar change to |
Yes, I was planning to fix the other Drains. I just started with vec::Drain to make sure I knew what I was doing. |
…cottmcm Remove incorrect comment in `Vec::drain` r? `@scottmcm` Turns out this comment wasn't correct for 6 years, since rust-lang#34951, which switched from using `slice::IterMut` into using `slice::Iter`.
…cottmcm Remove incorrect comment in `Vec::drain` r? ``@scottmcm`` Turns out this comment wasn't correct for 6 years, since rust-lang#34951, which switched from using `slice::IterMut` into using `slice::Iter`.
#30642
I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?