-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 9 pull requests #126332
Rollup of 9 pull requests #126332
Conversation
We can check that the vtable is for the right trait very early, and then just pass the type around.
To integrate rust-lang/rustc-perf#1926.
This test extracts a fragment of `issue-84561.rs` that has historically proven troublesome when trying to modify how spans are extracted from MIR.
This is a modified copy of `tests/mir-opt/coverage/instrument_coverage.rs`.
As more and more of the span refiner's functionality has been pulled out into separate early passes, it has finally reached the point where we can remove the rest of the old `SpansRefiner` code, and replace it with a single modestly-sized function.
Promote `arm64ec-pc-windows-msvc` to tier 2 MCP: <rust-lang/compiler-team#746> * Update platform support docs * Add `arm64ec-pc-windows-msvc` as a target to the existing AArch64 Windows build in CI. * Fix docs build break. * Add `arm64ec-pc-windows-msvc` to build manifest. CI build (succeeded, but upload to S3 failed): <https://github.com/rust-lang/rust/actions/runs/9388227822/job/25853013083?pr=126039>
…fcx, r=lcnr Remove `DebugWithInfcx` machinery This PR removes `DebugWithInfcx` after having a lot of second thoughts about it due to recent type system uplifting work. We could add it back later if we want, but I don't think the amount of boilerplate in the complier and the existence of (kindof) hacks like `NoInfcx` currently justify the existence of `DebugWithInfcx`, especially since it's not even being used anywhere in the compiler currently. The motivation for `DebugWithInfcx` is that we want to be able to print infcx-aware information, such as universe information[^1] (though if there are other usages that I'm overlooking, please let me know). I think there are probably more tailored solutions that can specifically be employed in places where this infcx-aware printing is necessary. For example, one way of achieving this is by implementing a custom `FmtPrinter` which overloads `ty_infer_name` (perhaps also extending it to have overrideable stubs for printing placeholders too) to print the `?u.i` name for an infer var. This will necessitate uplifting `Print` from `rustc_middle::ty::print`, but this seems a bit more extensible and reusable than `DebugWithInfcx`. One of the problems w/ `DebugWithInfcx` is its opt-in-ness. Even if a compiler dev adds a new `debug!(ty)` in a context where there is an `infcx` we can access, they have to *opt-in* to using `DebugWithInfcx` with something like `debug!(infcx.with(ty))`. This feels to me like it risks a lot of boilerplate, and very easy to just forget adding it at all, especially in cases like `#[instrument]`. A second problem is the `NoInfcx` type itself. It's necessary to have this dummy infcx implementation since we often want to print types outside of the scope of a valid `Infcx`. Right now, `NoInfcx` is only *partially* a valid implementation of `InferCtxtLike`, except for the methods that we specifically need for `DebugWithInfcx`. As I work on uplifting the trait solver, I actually want to add a lot more methods to `InferCtxtLike` and having to add `unreachable!("this should never be called")` stubs for uplifted methods like `next_ty_var` is quite annoying. In reality, I actually only *really* care about the second problem -- we could, perhaps, instead just try to get rid of `NoInfcx` and just just duplicate `Debug` and `DebugWithInfcx` for most types. If we're okay with duplicating all these implementations (though most of them would just be trivial `#[derive(Debug, DebugWithInfcx)]`), I'd be okay with that too 🤔 r? `@BoxyUwU` `@lcnr` would like to know your thoughts -- happy to discuss this further, mainly trying to bring this problem up [^1]: Which in my experience is only really necessary when we're debugging things like generalizer bugs.
…s, r=compiler-errors Provide correct parent for nested anon const Fixes rust-lang#126147 99% of this PR is just comments explaining what the issue is. `tcx.parent(` and `hir().get_parent_item(` give different results as the hir owner for all the hir of anon consts is the enclosing function. I didn't attempt to change that as being a hir owner requires a `DefId` and long term we want to stop creating anon consts' `DefId`s before hir ty lowering. So i just opted to change `generics_of` to use `tcx.parent` to get the parent for `AnonConst`'s. I'm not entirely sure about this being what we want, it does seem weird that we have two ways of getting the parent of an `AnonConst` and they both give different results. Alternatively we could just go ahead and make `const_evaluatable_unchecked` a hard error and stop providing generics to repeat exprs. Then this isn't an issue. (The FCW has been around for almost 4 years now) r? ````@compiler-errors````
…-obk interpret: dyn trait metadata check: equate traits in a proper way Hopefully fixes rust-lang/miri#3541... unfortunately we don't have a testcase. The first commit is just a refactor without functional change. r? `@oli-obk`
Simplify provider api to improve llvm ir This PR seeks to resolve the last concern in rust-lang#99301 (comment) We resolve the issue by moving the type_id to be stored in the `Request` itself rather than being accessed through the `Erased` trait, letting the compiler infer that the value of the type id will not change between lookups. ### LLVM Codegen **Before** ``` ; <provider_test::MyError as core::error::Error>::provide ; Function Attrs: nonlazybind uwtable define void `@"_ZN61_$LT$provider_test..MyError$u20$as$u20$core..error..Error$GT$7provide17hd9c9de412063aa73E"(ptr` noalias nocapture noundef nonnull readonly align 1 %self, ptr noundef nonnull align 1 %request.0, ptr noalias nocapture noundef readonly align 8 dereferenceable(32) %request.1) unnamed_addr #0 personality ptr `@rust_eh_personality` { start: %0 = getelementptr inbounds i8, ptr %request.1, i64 24 %self.1.val.i = load ptr, ptr %0, align 8 %1 = tail call { i64, i64 } %self.1.val.i(ptr noundef nonnull align 1 %request.0), !noalias !15 %2 = extractvalue { i64, i64 } %1, 0 %3 = extractvalue { i64, i64 } %1, 1 %_18.i.i = icmp ne i64 %2, 1101338453689927725 %_2.i.i = icmp ne i64 %3, 472224167662714873 %or.cond.i.not.i = select i1 %_18.i.i, i1 true, i1 %_2.i.i br i1 %or.cond.i.not.i, label %_ZN4core5error7Request7provide17h8f8125d2543333e0E.exit, label %bb2.i ``` **After** ``` ; <provider_test::MyError as provider_test::Error>::provide ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable define void `@"_ZN63_$LT$provider_test..MyError$u20$as$u20$provider_test..Error$GT$7provide17h5bbf091795a6d359E"(ptr` noalias nocapture noundef nonnull readonly align 1 %self, ptr nocapture noundef nonnull align 8 %request.0, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %request.1) unnamed_addr #2 personality ptr `@rust_eh_personality` { start: %_19.i = load i64, ptr %request.0, align 8, !noalias !3, !noundef !3 switch i64 %_19.i, label %_ZN13provider_test7Request7provide17heb3ee140962e3b2fE.exit [ i64 7665305208997882008, label %bb12.i i64 7050211241160863540, label %bb12.i3 i64 9112786072622981063, label %bb12.i11 ] ```
coverage: Replace the old span refiner with a single function As more and more of the span refiner's functionality has been pulled out into separate early passes, it has finally reached the point where we can remove the rest of the old `SpansRefiner` code, and replace it with a single modestly-sized function. ~~There should be no change to the resulting coverage mappings, as demonstrated by the lack of changes to test output.~~ There is *almost* no change to the resulting coverage mappings. There are some minor changes to `loop` that on inspection appear to be neutral in terms of accuracy, with the old behaviour being a slightly-horrifying implementation detail of the old code, so I think they're acceptable. Previous work in this direction includes: - rust-lang#125921 - rust-lang#121019 - rust-lang#119208
…, r=pnkfelix No uninitalized report in a pre-returned match arm This is a attemp to address rust-lang#126133
…zkan Update `rustc-perf` submodule To integrate rust-lang/rustc-perf#1926, required for rust-lang#126306. `@bors` rollup r? `@onur-ozkan`
… r=RalfJung Follow up to splitting core's PanicInfo and std's PanicInfo
@bors r+ p=5 rollup=never |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 0285dab54f In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (1d43fbb): comparison URL. Overall result: ❌ regressions - no action needed@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 -2.4%)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.959s -> 673.333s (-0.39%) |
Successful merges:
arm64ec-pc-windows-msvc
to tier 2 #126039 (Promotearm64ec-pc-windows-msvc
to tier 2)DebugWithInfcx
machinery #126075 (RemoveDebugWithInfcx
machinery)rustc-perf
submodule #126312 (Updaterustc-perf
submodule)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup