Skip to content

Implement TrustedRandomAccess for vec::Drain#81617

Closed
sdroege wants to merge 3 commits into
rust-lang:masterfrom
sdroege:vec-drain-trusted-random-access
Closed

Implement TrustedRandomAccess for vec::Drain#81617
sdroege wants to merge 3 commits into
rust-lang:masterfrom
sdroege:vec-drain-trusted-random-access

Conversation

@sdroege

@sdroege sdroege commented Feb 1, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2021
@rust-log-analyzer

This comment has been minimized.

@sdroege sdroege force-pushed the vec-drain-trusted-random-access branch from 020dfb8 to 1d33db3 Compare February 1, 2021 08:36
@oli-obk oli-obk added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 1, 2021
Comment thread library/alloc/src/vec/drain.rs
@Mark-Simulacrum

Copy link
Copy Markdown
Member

r? @m-ou-se for reassignment

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2021
@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2021
@Dylan-DPC-zz

Copy link
Copy Markdown

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned m-ou-se Mar 20, 2021
@Amanieu

Amanieu commented Mar 21, 2021

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Mar 21, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 1d33db3 has been approved by Amanieu

@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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2021
@bors

bors commented Mar 21, 2021

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1d33db3 with merge e5642fd10b149d75caa992b4327123129d14f902...

@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Mar 21, 2021

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 21, 2021
@JohnTitor JohnTitor added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jul 27, 2021
@JohnTitor

Copy link
Copy Markdown
Member

Marking as S-blocked as per #81617 (comment).

Comment thread library/alloc/src/vec/drain.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now that #85874 has landed this should become TrustedRandomAccessNoCoerce

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Switched over to TrustedRandomAccessNoCoerce. Thanks and sorry for the delay!

@the8472 the8472 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jul 29, 2021
@crlf0710

Copy link
Copy Markdown
Member

Ping from triage, any updates on this?

@camelid camelid 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 2, 2021
@JohnCSimon

Copy link
Copy Markdown
Member

@sdroege
Ping again from triage, any updates on this?

@camelid camelid 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 8, 2021
@sdroege sdroege force-pushed the vec-drain-trusted-random-access branch from 9c70fcb to 19480c1 Compare October 10, 2021 18:21
@GuillaumeGomez GuillaumeGomez 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 Oct 10, 2021
@GuillaumeGomez

Copy link
Copy Markdown
Member

Ready for a new round of review! :)

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 31, 2021

@the8472 the8472 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Taking over review of this.

Overall it seems safe, just the safety comment could use some expansion

r? @the8472

// 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`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@the8472 the8472 assigned the8472 and unassigned Amanieu Nov 5, 2021
@the8472 the8472 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 Nov 5, 2021
@JohnCSimon

Copy link
Copy Markdown
Member

Ping from triage:
@sdroege Can you please address the comment from the8472 and adjust the label with @rustbot ready when you're ready for review

@bors

bors commented Dec 9, 2021

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #85157) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon

Copy link
Copy Markdown
Member

Ping from triage:
@sdroege
I'm closing this due to inactivity, Please reopen when you are ready to continue with this. Thank you.

@rustbot label: +S-inactive

@JohnCSimon JohnCSimon closed this Jan 30, 2022
@rustbot rustbot added the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.