Skip to content

Implement push_mut #135975

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

Merged
merged 1 commit into from
Jul 31, 2025
Merged

Implement push_mut #135975

merged 1 commit into from
Jul 31, 2025

Conversation

balt-dev
Copy link
Contributor

@balt-dev balt-dev commented Jan 24, 2025

Implementation of #135974.

@rustbot
Copy link
Collaborator

rustbot commented Jan 24, 2025

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 author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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
Copy link
Contributor Author

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
Copy link
Member

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

@balt-dev
Copy link
Contributor Author

Alright, I'll do that soon.

@ibraheemdev ibraheemdev 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 Jan 31, 2025
@balt-dev

This comment was marked as off-topic.

@balt-dev
Copy link
Contributor Author

@rustbot review

@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
///
/// 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) };
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

@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.

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label May 31, 2025
@balt-dev

This comment was marked as off-topic.

@balt-dev
Copy link
Contributor Author

balt-dev commented May 31, 2025

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?

Copy link
Contributor

@tgross35 tgross35 left a comment

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
Copy link
Contributor Author

Will do!

@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Jul 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 30, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs

cc @jdonszelmann

@balt-dev
Copy link
Contributor Author

...oops.

@balt-dev
Copy link
Contributor Author

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

@sayantn
Copy link
Contributor

sayantn commented Jul 30, 2025

@rustbot label -A-attributes

@rustbot rustbot removed the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Jul 30, 2025
@balt-dev
Copy link
Contributor Author

@sayantn Thank you!

@WaffleLapkin
Copy link
Member

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

@tgross35
Copy link
Contributor

tgross35 commented Jul 30, 2025

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
Copy link
Collaborator

bors commented Jul 30, 2025

📌 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
bors added a commit that referenced this pull request Jul 31, 2025
Rollup of 6 pull requests

Successful merges:

 - #135975 (Implement `push_mut`)
 - #143672 (Fix Box allocator drop elaboration)
 - #144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend)
 - #144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation")
 - #144683 (Simplify library dependencies on `compiler-builtins`)
 - #144685 (Only extract lang items once in codegen_fn_attrs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 31, 2025
Implement `push_mut`

Implementation of #135974.
@bors
Copy link
Collaborator

bors commented Jul 31, 2025

⌛ Testing commit 3ccfa14 with merge 7581ecc...

@Zalathar
Copy link
Contributor

Yielding to enclosing rollup:

@bors retry

bors added a commit that referenced this pull request Jul 31, 2025
Rollup of 6 pull requests

Successful merges:

 - #135975 (Implement `push_mut`)
 - #143672 (Fix Box allocator drop elaboration)
 - #144232 (Implement support for `become` and explicit tail call codegen for the LLVM backend)
 - #144663 (coverage: Re-land "Enlarge empty spans during MIR instrumentation")
 - #144685 (Only extract lang items once in codegen_fn_attrs)
 - #144717 (Move `rustc_middle::parameterized`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dc8aec4 into rust-lang:master Jul 31, 2025
10 of 11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 31, 2025
@bors
Copy link
Collaborator

bors commented Jul 31, 2025

⌛ Testing commit 3ccfa14 with merge cc0a5b7...

rust-timer added a commit that referenced this pull request Jul 31, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.