Implement push_mut by balt-dev · Pull Request #135975 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation163 Commits1 Checks10 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@balt-dev

@rustbot

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ibraheemdev (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

@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

Jan 24, 2025

@balt-dev

Sorry if I did this wrong, it's my first time!

@rust-log-analyzer

This comment has been minimized.

@balt-dev

This comment was marked as off-topic.

@rust-log-analyzer

This comment has been minimized.

@ibraheemdev

I'm not sure we should be touching Vec::push here.. maybe just duplicate the implementation?

@balt-dev

Alright, I'll do that soon.

@balt-dev

This comment was marked as off-topic.

balt-dev

@balt-dev

@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 22, 2025

ibraheemdev

///
/// let mut vec = vec![];
/// // Due to current borrow checker limitations (see -Zpolonius), this is the only way to spell this right now.
/// let last = if let Some(v) = vec.last_mut() { v } else { vec.push_mut(0) };

Choose a reason for hiding this comment

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

I'm not sure I understand the point of this.

Choose a reason for hiding this comment

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

There should probably be a better example, yeah. Will update soon!

@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 23, 2025

@alex-semenyuk

@balt-dev
Thanks for your contribution
From wg-triage. Any updates on this PR?

@balt-dev

This comment was marked as off-topic.

@balt-dev

This comment was marked as off-topic.

@rustbot

This comment has been minimized.

@balt-dev

This comment was marked as off-topic.

@balt-dev

I think I messed up my fork so bad I'll have to reset it and put my code in from scratch in order to get rid of the merge commit. At least it's copy/pasteable?

tgross35

Choose a reason for hiding this comment

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

LGTM, please just squash

@balt-dev

@rustbot

@balt-dev

@balt-dev

@balt-dev

Accidentally got a little overzealous with my git rebase -i HEAD~4. How do I remove the A-attributes label?

@sayantn

@balt-dev

@WaffleLapkin

If this gets merged as-is, please update the tracking issue to include all added methods.

@tgross35

Thank you for all the persistence in getting this over the line! Hopefully the next PR will be a bit smoother :)

@bors r+


If this gets merged as-is, please update the tracking issue to include all added methods.

Argh, this whole time I was thinking this was all in the ACP. The VecDeque/LinkedList portion is a logical extension of push_mut and Mara did chime in about the signature for insert above, so I think it's fine without kicking it back to libs-api. Cc @rust-lang/libs-api in case anyone has any concerns.

I updated the tracking issue.

@bors

📌 Commit 3ccfa14 has been approved by tgross35

It is now in the queue for this repository.

@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

Jul 30, 2025

Zalathar added a commit to Zalathar/rust that referenced this pull request

Jul 31, 2025

@Zalathar

bors added a commit that referenced this pull request

Jul 31, 2025

@bors

Rollup of 6 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit that referenced this pull request

Jul 31, 2025

@bors

Implement push_mut

Implementation of #135974.

@bors

@Zalathar

Yielding to enclosing rollup:

@bors retry

bors added a commit that referenced this pull request

Jul 31, 2025

@bors

Rollup of 6 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

@bors

rust-timer added a commit that referenced this pull request

Jul 31, 2025

@rust-timer

Rollup merge of #135975 - balt-dev:master, r=tgross35

Implement push_mut

Implementation of #135974.

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Aug 2, 2025

@Zalathar

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.