Rustc pull update - #2215
Open
workflows-stdarch[bot] wants to merge 8 commits into
Open
Conversation
perf: Push nominal obligations instead of returning them `WfPredicates::nominal_obligations` built a per-predicate `Vec` of origins and a fully instantiated `InstantiatedPredicates` before collecting the result. Instead, this PR walks the `predicates_of` parent chain by recursion and instantiate each level directly into the result, which is allocated once with the exact size. Most items have no parent, so that case is handled in `nominal_obligations` inline, so this common path stays free of calls.
allow `-Ldependency` search paths for panic runtimes Part of [build-std=always RFC](https://rust-lang.github.io/rfcs/3874-build-std-always.html). This PR supports `-Ldependency=` search paths for panic runtimes. This will allow Cargo to treat panic runtimes as regular transitive dependencies, rather than special-casing them. To do so: 1. During panic runtime injection we remove the early‑return `only_rlib` check. As a result the panic runtime is injected as a conditional dependency when building `std` and is subsequently included in `std`'s metadata. When building a crate that uses `std`, the panic runtime is resolved through `resolve_crate_deps` in the same way as any other transitive dependency. </br> For a prebuilt `std` (unlike `build-std`), the `-Cpanic=` option passed to `std` may differ from that passed to its dependents, so we might still need to inject another panic runtime as a direct dependency. However, this is not important in the context of prebuilt std. 2. `NoPanicStrategy` is checked only for `panic_abort`. We can compile `panic_unwind` with `-Cpanic=abort` for some targets. This was previously overlooked. #### Summary of the history and discussions in this PR 1. In the first iteration of this PR `PathKind` for injected dependencies was simply changed from `-Lcrate=` to `-Ldependency`, but this raised a [concern](rust-lang/rust#160007 (comment)). Bjorn3 [suggested](rust-lang/rust#160007 (comment)) to include both panic runtimes as a dependency of `std` so we don't have to inject it as a dependency for any user of `std`. The correct one should then be activated later in `dependency_format.rs`. 2. In the second iteration Bjorn3's suggestion was implemented. The problem was that for `build-std=always`, we might want to avoid building `panic_unwind` when not necessary. From the compiler perspective we need to </br> 2.1. Either always resolve `panic_unwind` and ignore any resulting error. (might lead to bugs) 2.2. Or conditionally resolve `panic_unwind`. For `build-std` we might rely on `-Cpanic=` option for this in accordance with [panic strategies](https://rust-lang.github.io/rfcs/3874-build-std-always.html#panic-strategies) but for prebuilt `std` this will fail for some targets. </br> It was decided to relax the implementation so we can inject panic runtime as direct dependency for prebuilt `std`. 3. Third iteration: we are here cc @adamgemmell
This makes it clear that it is only meant for LLVM intrinsics and not for defining or calling arbitrary user functions.
Rename extern "unadjusted" to extern "llvm-intrinsic" This makes it clear that it is only meant for LLVM intrinsics and not for defining or calling arbitrary user functions. Follow up to rust-lang/rust#160077
…kang Refactor the `#[allow(dead_code)]` propagation for impl items of traits Extracted from rust-lang/rust#157885. This PR does the refactor and corrects the previous implementation. The following will fail currently ([play](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=3279902b2d2e6b0fe75c5af565b1cddd)): ```rust #![deny(dead_code)] #![deny(unfulfilled_lint_expectations)] #[allow(dead_code)] pub trait Tr { fn foo(&self); } struct Foo; impl Tr for Foo { fn foo(&self) { bar(); } } #[expect(dead_code)] fn bar() {} fn main() {} ``` After this PR, we could handle the `#[allow(dead_code)]` propagation correctly, and should get perf improvement.
Consolidate LLVM skip in check builds in bootstrap Before it was distributed amongst two places, which made it harder to follow the logic, and the `RUST_CHECK` logic was also applied for *anything* being built, even though it is only relevant for rustc itself. This PR centralizes the handling, and also enables it for `doc` builds. So `./x doc compiler` now doesn't require building LLVM 🎉 r? jieyouxu
This updates the rust-version file to 4b7e3a76d8df78960dc7c65cad43f5da1dac8ade.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@4b7e3a7 Filtered ref: a06561a Upstream diff: rust-lang/rust@da51146...4b7e3a7 This merge was created using https://github.com/rust-lang/josh-sync.
Collaborator
|
Thanks for the pull request, and welcome! The Rust Project has assigned @sayantn (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Why was this reviewer chosen?The reviewer was selected based on:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Latest update from rustc.