-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Implement push_mut
#135975
Conversation
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 (
|
Sorry if I did this wrong, it's my first time! |
This comment has been minimized.
This comment has been minimized.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been minimized.
This comment has been minimized.
I'm not sure we should be touching |
Alright, I'll do that soon. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@rustbot review |
library/alloc/src/vec/mod.rs
Outdated
/// | ||
/// 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) }; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
@balt-dev |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been minimized.
This comment has been minimized.
This comment was marked as off-topic.
This comment was marked as off-topic.
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? |
There was a problem hiding this 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
Will do! |
Some changes occurred in compiler/rustc_codegen_ssa
cc @Amanieu, @folkertdev, @sayantn Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs |
...oops. |
Accidentally got a little overzealous with my |
@rustbot label -A-attributes |
@sayantn Thank you! |
If this gets merged as-is, please update the tracking issue to include all added methods. |
Thank you for all the persistence in getting this over the line! Hopefully the next PR will be a bit smoother :) @bors r+
Argh, this whole time I was thinking this was all in the ACP. The I updated the tracking issue. |
Implement `push_mut` Implementation of rust-lang#135974.
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
Implement `push_mut` Implementation of #135974.
Yielding to enclosing rollup: @bors retry |
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
Implement `push_mut` Implementation of rust-lang#135974.
Implementation of #135974.