-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 7 pull requests #138714
Rollup of 7 pull requests #138714
Conversation
A check for `#[non_exhaustive]` is often done in combination with checking whether the type is local to the crate, in a variety of ways. Create a helper method and standardize on it as the way to check for this.
Eliminate any redundant, unobservable logic from the their default method implementations. The observable changes are that `Write::write_fmt` for both types now ignores the formatting arguments, so a user fmt impl which has side effects is not invoked, and `Write::write_all_vectored` for both types does not advance the borrowed buffers. Neither behavior is guaranteed by the docs and the latter is documented as unspecified. `Empty` is not marked as vectored, so that `Chain<Empty, _>` and `Chain<_, Empty>` are not forced to be vectored.
Introduce feature `const_split_off_first_last` Mark `split_off_first`, `split_off_first_mut`, `split_off_last`, and `split_off_last_mut` unstably const
…ggest moving it to the header.
This removes E0773 "A builtin-macro was defined more than once."
…r=tgross35 `MaybeUninit` inherent slice methods part 2 These were moved out of rust-lang#129259 since they require additional libs-api approval. Tracking issue: rust-lang#117428. New API surface: ```rust impl<T> [MaybeUninit<T>] { // replacing fill; renamed to avoid conflict pub fn write_filled(&mut self, value: T) -> &mut [T] where T: Clone; // replacing fill_with; renamed to avoid conflict pub fn write_with<F>(&mut self, value: F) -> &mut [T] where F: FnMut() -> T; // renamed to remove "fill" terminology, since this is closer to the write_*_of_slice methods pub fn write_iter<I>(&mut self, iter: I) -> (&mut [T], &mut Self) where I: Iterator<Item = T>; } ``` Relevant motivation for these methods; see rust-lang#129259 for earlier methods' motiviations. * I chose `write_filled` since `filled` is being used as an object here, whereas it's being used as an action in `fill`. * I chose `write_with` instead of `write_filled_with` since it's shorter and still matches well. * I chose `write_iter` because it feels completely different from the fill methods, and still has the intent clear. In all of the methods, it felt appropriate to ensure that they contained `write` to clarify that they are effectively just special ways of doing `MaybeUninit::write` for each element of a slice. Tracking issue: rust-lang#117428 r? libs-api
…y, r=m-ou-se Implement default methods for `io::Empty` and `io::Sink` Implements default methods of `io::Read`, `io::BufRead`, and `io::Write` for `io::Empty` and `io::Sink`. These implementations are equivalent to the defaults, except in doing less unnecessary work. `Read::read_to_string` and `BufRead::read_line` both have a redundant call to `str::from_utf8` which can't be inlined from `core` and `Write::write_all_vectored` has slicing logic which can't be simplified (See on [Compiler Explorer](https://rust.godbolt.org/z/KK6xcrWr4)). The rest are optimized to the minimal with `-C opt-level=3`, but this PR gives that benefit to unoptimized builds. This includes an implementation of `Write::write_fmt` which just ignores the `fmt::Arguments<'_>`. This could be problematic whenever a user formatting impl is impure, but the docs do not guarantee that the args will be expanded. Tracked in rust-lang#136756. r? `@m-ou-se`
… r=Nadrieril mir_build: consider privacy when checking for irrefutable patterns This PR fixes rust-lang#137999. Note that, since this makes the compiler reject code that was previously accepted, it will probably need a crater run. I include a commit that factors out a common code pattern into a helper function, purely because the fact that this was repeated all over the place was bothering me. Let me know if I should split that into a separate PR instead.
…, r=m-ou-se core/slice: Mark some `split_off` variants unstably const Tracking issue: rust-lang#138539 Add feature gate `#![feature(const_split_off_first_last)]` Mark `split_off_first`, `split_off_first_mut`, `split_off_last`, and `split_off_last_mut` slice methods unstably const
…here-loop-body-help, r=petrochenkov If a label is placed on the block of a loop instead of the header, suggest moving it to the header. Fixes rust-lang#138585 If a label is placed on the block of a loop instead of the header, suggest to the user moving it to the loop header instead of ~~suggesting to remove it~~ emitting a tool-only suggestion to remove it. ```rs fn main() { loop 'a: { return; } } ``` ```diff error: block label not supported here --> src/main.rs:2:10 | 2 | loop 'a: { return; } | ^^^ not supported here + | +help: if you meant to label the loop, move this label before the loop + | +2 - loop 'a: { return; } +2 + 'a: loop { return; } + | ``` Questions for reviewer: * The "desired output" in the linked issue had the main diagnostic be "misplaced loop label". Should the main diagnostic message the changed instead of leaving it as "block label not supported here"? * Should this be `Applicability::MachineApplicable`?
Fix next solver handling of shallow trait impl check I'm trying to remove unnecessary direct calls to `select`, and this one seemed like a good place to start 😆 r? `@compiler-errors` or `@lcnr`
…ann,petrochenkov Remove E0773 "A builtin-macro was defined more than once." Error E0773 "A builtin-macro was defined more than once" is triggered when using the same `#[rustc_builtin_macro(..)]` twice. However, it can only be triggered in unstable code (using a `rustc_` attribute), and there doesn't seem to be any harm in using the same implementation from `compiler/rustc_builtin_macros/…` for multiple macro definitions. By changing the Box to an Arc in `SyntaxExtensionKind`, we can throw away the `BuiltinMacroState::{NotYetSeen, AlreadySeen}` logic, simplifying things.
@bors r+ rollup=never p=5 |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135394 (`MaybeUninit` inherent slice methods part 2) - rust-lang#137051 (Implement default methods for `io::Empty` and `io::Sink`) - rust-lang#138001 (mir_build: consider privacy when checking for irrefutable patterns) - rust-lang#138540 (core/slice: Mark some `split_off` variants unstably const) - rust-lang#138589 (If a label is placed on the block of a loop instead of the header, suggest moving it to the header.) - rust-lang#138594 (Fix next solver handling of shallow trait impl check) - rust-lang#138613 (Remove E0773 "A builtin-macro was defined more than once.") Failed merges: - rust-lang#138602 (Slim `rustc_parse_format` dependencies down) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 1aeb99d248 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 1aeb99d (parent) -> 2947be7 (this PR) Test differencesShow 201 test diffs
Additionally, 120 doctest diffs were found. These are ignored, as they are noisy. Job group index
|
Finished benchmarking commit (2947be7): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.3%, secondary -1.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 3.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 774.586s -> 774.968s (0.05%) |
Successful merges:
MaybeUninit
inherent slice methods part 2 #135394 (MaybeUninit
inherent slice methods part 2)io::Empty
andio::Sink
#137051 (Implement default methods forio::Empty
andio::Sink
)split_off
variants unstably const #138540 (core/slice: Mark somesplit_off
variants unstably const)Failed merges:
rustc_parse_format
dependencies down #138602 (Slimrustc_parse_format
dependencies down)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup