-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 14 pull requests #76912
Merged
Merged
Rollup of 14 pull requests #76912
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
This commit moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types. Signed-off-by: David Wood <david@davidtw.co>
This is very similar to the existing `Box<[T; N]>: TryFrom<Box<[T]>>`, but allows avoiding the `shrink_to_fit` if you have a vector and not a boxed slice.
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Trait implementations effectively can't be #[unstable].
Since trait implementations cannot be unstable, we should only add them when the as_str feature gets stabilized. Until then, only `.as_str()` is available (behind a feature gate).
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
…ts (clippy::unnecessary_lazy_evaluations)
…acrum deny(unsafe_op_in_unsafe_fn) in libstd/path.rs The libstd/path.rs part of rust-lang#73904 . Wraps the two calls to an unsafe fn Initializer::nop() in an unsafe block.
…ion, r=eddyb lint/ty: move fns to avoid abstraction violation This PR moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types, hopefully addressing @eddyb's concern [from this comment](rust-lang#74340 (comment)).
…n-const-fn, r=RalfJung Use implicit (not explicit) rules for promotability by default in `const fn` For crater run. See rust-lang/const-eval#54 (comment). cc rust-lang#75586
Add test for checking duplicated branch or-patterns This adds a regression test for checking `or-patterns` in MIR as shown in rust-lang#75439. This doesn't introduce a fix as I'm not sure where it would go(I suspect maybe here: src/librustc_mir_build/build/matches/mod.rs), and I'm not particularly able to fix it. cc: @lzutao
Add `[T; N]: TryFrom<Vec<T>>` (insta-stable) This is very similar to the [existing](https://doc.rust-lang.org/nightly/std/convert/trait.TryFrom.html#impl-TryFrom%3CBox%3C%5BT%5D%3E%3E) `Box<[T; N]>: TryFrom<Box<[T]>>`, but allows avoiding the `shrink_to_fit` if you have a vector and not a boxed slice. Like the slice equivalents of this, it fails if the length of the vector is not exactly `N`. This uses `Vec<T>` as the `Error` type to return the input, like how the `Rc<[T]> -> Rc<[T; N]>` (and Arc) ones also reflect the input directly in the error type. ```rust #[stable(feature = "array_try_from_vec", since = "1.47.0")] impl<T, const N: usize> TryFrom<Vec<T>> for [T; N] { type Error = Vec<T>; fn try_from(mut vec: Vec<T>) -> Result<[T; N], Vec<T>>; } ``` Inspired by this zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/APIs.20for.20getting.20stuff.20from.20a.20Vec.20by.20owned/near/209048103
Clean up vec benches bench_in_place style
do not inline black_box when building for Miri We cannot do the assembly trick in Miri, but let's at least make sure MIR inlining does not circumvent the black_box. Also use black_box instead of local optimization barriers in a few const tests.
…r=dtolnay Add associated constant `BITS` to all integer types Recently I've regularly come across this snippet (in a few different crates, including `core` and `std`): ```rust std::mem::size_of<usize>() * 8 ``` I think it's time for a `usize::BITS`.
…in, r=dtolnay Add as_str() to string::Drain. Vec's Drain recently [had its `.as_slice()` stabilized](rust-lang#72584), but String's Drain was still missing the analogous `.as_str()`. This adds that. Also improves the Debug implementation, which now shows the remaining data instead of just `"Drain { .. }"`.
assert ScalarMaybeUninit size I noticed most low-level Miri types have such an assert but `ScalarMaybeUninit` does not, so let's add that. Good t see that the `Option`-like optimization kicks in and this is no bigger than `Scalar`. :) r? @oli-obk
give *even better* suggestion when matching a const range notice that the err already has "constant defined here" so this is now *exceedingly clear* extension to rust-lang#76222 r? @estebank
don't convert types to the same type with try_into (clippy::useless_conversion)
Give a better error message when x.py uses the wrong stage for CI r? @shepmaster
…yn514 Build fixes for RISC-V 32-bit Linux support This fixes build issues with the 32-bit RISC-V port.
📌 Commit b4c3f40 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
Sep 19, 2020
Cc @Dylan-DPC (just realized I might not be at a computer when this runs, so if it fails would be good if you could take a look) |
☀️ Test successful - checks-actions, checks-azure |
This was referenced Sep 19, 2020
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:
const fn
#75502 (Use implicit (not explicit) rules for promotability by default inconst fn
)[T; N]: TryFrom<Vec<T>>
(insta-stable) #76310 (Add[T; N]: TryFrom<Vec<T>>
(insta-stable))BITS
to all integer types #76492 (Add associated constantBITS
to all integer types)Failed merges:
r? @ghost