Implement TrustedRandomAccess for vec::Drain#81617
Implement TrustedRandomAccess for vec::Drain#81617sdroege wants to merge 3 commits intorust-lang:masterfrom
TrustedRandomAccess for vec::Drain#81617Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
020dfb8 to
1d33db3
Compare
|
r? @m-ou-se for reassignment |
|
r? @Amanieu |
|
@bors r+ |
|
📌 Commit 1d33db3 has been approved by |
|
⌛ Testing commit 1d33db3 with merge e5642fd10b149d75caa992b4327123129d14f902... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
Marking as S-blocked as per #81617 (comment). |
library/alloc/src/vec/drain.rs
Outdated
There was a problem hiding this comment.
Now that #85874 has landed this should become TrustedRandomAccessNoCoerce
There was a problem hiding this comment.
Switched over to TrustedRandomAccessNoCoerce. Thanks and sorry for the delay!
|
Ping from triage, any updates on this? |
|
@sdroege |
…pping Otherwise this simply causes advancing of the iterator with no other effects, which is unnecessary work.
9c70fcb to
19480c1
Compare
|
Ready for a new round of review! :) |
| // requires each index to be accessed only once, this is safe to do here. | ||
| // | ||
| // TrustedRandomAccess (without NoCoerce) must not be implemented because | ||
| // subtypes/supertypes of `T` might not be `NonDrop` |
There was a problem hiding this comment.
Drain is a bit more complicated than IntoIter due to its Drop impl doing actual work even for T: Copy. This comment should mention why this is still ok. Something along the lines that the tail move does not depend on how much has been drained.
|
Ping from triage: |
|
☔ The latest upstream changes (presumably #85157) made this pull request unmergeable. Please resolve the merge conflicts. |
No description provided.