-
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 6 pull requests #129202
Rollup of 6 pull requests #129202
Conversation
`Either` is wasteful for a one-or-none iterator, especially since `Once` is already an `option::IntoIter` internally. We don't really need any of the iterator mechanisms in this case, just a single conditional insert.
This re-lookup of `&hir::Pat` by its ID appears to be an artifact of earlier complexity that has since been removed from the compiler.
… r=petrochenkov Emit an error for invalid use of the linkage attribute fixes rust-lang#128486 Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it. Related: rust-lang#128552.
…eril mir/pretty: use `Option` instead of `Either<Once, Empty>` `Either` is wasteful for a one-or-none iterator, especially since `Once` is already an `option::IntoIter` internally. We don't really need any of the iterator mechanisms in this case, just a single conditional insert.
…r=compiler-errors Return correct HirId when finding body owner in diagnostics Fixes rust-lang#129145 Fixes rust-lang#128810 r? ```@compiler-errors``` ```rust fn generic<const N: u32>() {} trait Collate<const A: u32> { type Pass; fn collate(self) -> Self::Pass; } impl<const B: u32> Collate<B> for i32 { type Pass = (); fn collate(self) -> Self::Pass { generic::<{ true }>() //~^ ERROR: mismatched types } } ``` When type checking the `{ true }` anon const we would error with a type mismatch. This then results in diagnostics code attempting to check whether its due to a type mismatch with the return type. That logic was implemented by walking up the hir until we reached the body owner, except instead of using the `enclosing_body_owner` function it special cased various hir nodes incorrectly resulting in us walking out of the anon const and stopping at `fn collate` instead. This then resulted in diagnostics logic inside of the anon consts `ParamEnv` attempting to do trait solving involving the `<i32 as Collate<B>>::Pass` type which ICEs because it is in the wrong environment. I have rewritten this function to just walk up until it hits the `enclosing_body_owner` and made some other changes since I found this pretty hard to read/understand. Hopefully it's easier to understand now, it also makes it more obvious that this is not implemented in a very principled way and is definitely missing cases :)
…r=GuillaumeGomez rustdoc-json: Clean up serialization and printing. Somewhat a followup to rust-lang#128963, but makes sense regardless. - Renames `out_path` to `out_dir` because it's not the path to the JSON, but the directory - Also adds a comment explaining `None` - Renames `write` to `serialize_and_write` because it does both. - Also renames the self-profile activity name to be clear this measures both IO cost and serialization CPU cost - Expands the timer to cover flushing - Renames `output` to `output_crate`, to emphasize it's the contents, not the `--output` flag. r? `@GuillaumeGomez`
…octest-attrs, r=notriddle Remove useless attributes in merged doctest generated code I took another look at the generated code for merged doctests and it seems like those attributes are only useful when running `rustc --test`, which isn't the case for merged doctests. Less code generated. \o/ r? `@notriddle`
…rors Remove a useless ref/id/ref round-trip from `pattern_from_hir` This re-lookup of `&hir::Pat` by its ID appears to be an artifact of earlier complexity that has since been removed from the compiler. Merely deleting the let/match results in borrow errors, but sprinkling `'tcx` in the signature allows it to work again, so I suspect that this code's current function is simply to compensate for overly loose lifetimes in the signature. Perhaps it made more sense at a time when HIR lifetimes were not tied to `'tcx`. I spotted this while working on some more experimental changes, which is why I've extracted it into its own PR.
@bors r+ rollup=never p=6 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 9b318d2e93 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (0f26ee4): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -4.3%)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 (primary -3.4%, secondary -2.9%)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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 750.64s -> 750.326s (-0.04%) |
The @rustbot label: +perf-regression-triaged |
Successful merges:
Option
instead ofEither<Once, Empty>
#129167 (mir/pretty: useOption
instead ofEither<Once, Empty>
)pattern_from_hir
#129196 (Remove a useless ref/id/ref round-trip frompattern_from_hir
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup