-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 11 pull requests #81952
Merged
Merged
Rollup of 11 pull requests #81952
Conversation
This file contains 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
Updated to specify the underlying syscalls
Fix link reference Co-authored-by: Joshua Nelson <joshua@yottadb.com>
This commit introduces a new method to the public API, under `vec_split_at_spare` feature gate: ```rust impl<T, A: Allocator> impl Vec<T, A> { pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]); } ``` The method returns 2 slices, one slice references the content of the vector, and the other references the remaining spare capacity. The method was previously implemented while adding `Vec::extend_from_within`, and used to implement `Vec::spare_capacity_mut` (as the later is just a subset of former one).
Co-authored-by: the8472 <the8472@users.noreply.github.com>
These methods missed the beta cutoff
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
This fixes the following warning when compiling with nightly: ``` warning: panic message is not a string literal --> src/bootstrap/builder.rs:1515:24 | 1515 | panic!(out); | ^^^ | = note: `#[warn(non_fmt_panic)]` on by default = note: this is no longer accepted in Rust 2021 help: add a "{}" format string to Display the message | 1515 | panic!("{}", out); | ^^^^^ help: or use std::panic::panic_any instead | 1515 | std::panic::panic_any(out); | ^^^^^^^^^^^^^^^^^^^^^^ ```
This renames the variants in HIR UnOp from enum UnOp { UnDeref, UnNot, UnNeg, } to enum UnOp { Deref, Not, Neg, } Motivations: - This is more consistent with the rest of the code base where most enum variants don't have a prefix. - These variants are never used without the `UnOp` prefix so the extra `Un` prefix doesn't help with readability. E.g. we don't have any `UnDeref`s in the code, we only have `UnOp::UnDeref`. - MIR `UnOp` type variants don't have a prefix so this is more consistent with MIR types. - "un" prefix reads like "inverse" or "reverse", so as a beginner in rustc code base when I see "UnDeref" what comes to my mind is something like "&*" instead of just "*".
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
Clarify docs regarding sleep of zero duration Clarify that the behaviour of sleep() when given a duration of zero is actually platform specific.
Add `Box::into_inner`. This adds a `Box::into_inner` method to the `Box` type. <del>I actually suggest deprecating the compiler magic of `*b` if this gets stablized in the future.</del> r? `@m-ou-se`
…hod-for-loop, r=oli-obk Add suggest mut method for loop Part of rust-lang#49839 This PR focus on [the comment case](rust-lang#49839 (comment))
Make Vec::split_at_spare_mut public This PR introduces a new method to the public API, under `vec_split_at_spare` feature gate: ```rust impl<T, A: Allocator> impl Vec<T, A> { pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]); } ``` The method returns 2 slices, one slice references the content of the vector, and the other references the remaining spare capacity. The method was previously implemented while adding `Vec::extend_from_within` in rust-lang#79015, and used to implement `Vec::spare_capacity_mut` (as the later is just a subset of former one). See also previous [discussion in `Vec::spare_capacity_mut` tracking issue](rust-lang#75017 (comment)). ## Unresolved questions - [ ] Should we consider changing the name? `split_at_spare_mut` doesn't seem like an intuitive name - [ ] Should we deprecate `Vec::spare_capacity_mut`? Any usecase of `Vec::spare_capacity_mut` can be replaced with `Vec::split_at_spare_mut` (but not vise-versa) r? `@KodrAus`
… r=jyn514 Bump stabilization version for const int methods These methods missed the beta cutoff. See rust-lang#80962 for details. `@rustbot` modify labels to +A-const-fn, +A-intrinsics r? `@m-ou-se`
…fs, r=estebank [compiler/rustc_typeck/src/check/expr.rs] Remove unnecessary refs in pattern matching
Use format string in bootstrap panic instead of a string directly This fixes the following warning when compiling with nightly: ``` warning: panic message is not a string literal --> src/bootstrap/builder.rs:1515:24 | 1515 | panic!(out); | ^^^ | = note: `#[warn(non_fmt_panic)]` on by default = note: this is no longer accepted in Rust 2021 help: add a "{}" format string to Display the message | 1515 | panic!("{}", out); | ^^^^^ help: or use std::panic::panic_any instead | 1515 | std::panic::panic_any(out); | ^^^^^^^^^^^^^^^^^^^^^^ ``` Found while working on rust-lang#79540. cc rust-lang#81645, which landed in 1.51.
…wjasper Rename HIR UnOp variants This renames the variants in HIR UnOp from enum UnOp { UnDeref, UnNot, UnNeg, } to enum UnOp { Deref, Not, Neg, } Motivations: - This is more consistent with the rest of the code base where most enum variants don't have a prefix. - These variants are never used without the `UnOp` prefix so the extra `Un` prefix doesn't help with readability. E.g. we don't have any `UnDeref`s in the code, we only have `UnOp::UnDeref`. - MIR `UnOp` type variants don't have a prefix so this is more consistent with MIR types. - "un" prefix reads like "inverse" or "reverse", so as a beginner in rustc code base when I see "UnDeref" what comes to my mind is something like `&*` instead of just `*`.
…547, r=GuillaumeGomez Add long explanation for E0547 Helps with rust-lang#61137
add suggestion to use the `async_recursion` crate Closes rust-lang#81907 CC `@estebank`
Update cargo 5 commits in 34170fcd6e0947808a1ac63ac85ffc0da7dace2f..ab64d1393b5b77c66b6534ef5023a1b89ee7bf64 2021-02-04 15:52:52 +0000 to 2021-02-10 00:19:10 +0000 - Allow `true` and `false` as options for `strip` option (rust-lang/cargo#9153) - Change git dependencies to use `HEAD` by default (rust-lang/cargo#9133) - appendix auth gcm link to new repo (which is xplat) (rust-lang/cargo#9152) - Fix warnings of the new non_fmt_panic lint (rust-lang/cargo#9148) - Fix panic with doc collision orphan. (rust-lang/cargo#9142)
@bors r+ p=11 rollup=never |
📌 Commit 77114af has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Feb 10, 2021
☀️ Test successful - checks-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged-by-bors
This PR was explicitly merged by bors.
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
Box::into_inner
. #80438 (AddBox::into_inner
.)async_recursion
crate #81926 (add suggestion to use theasync_recursion
crate)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup