-
Notifications
You must be signed in to change notification settings - Fork 558
Rustc pull update #2595
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
Merged
Merged
Rustc pull update #2595
+32
−5
Conversation
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
Add assignment type analysis for ide-completion
Add remove literal dbg stmt for remove_dbg
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 21a19c297d4f5a03501d92ca251bd7a17073c08a Filtered ref: 9a5c1fb93028e1a29a7598ce782efb0c5d7be534 This merge was created using https://github.com/rust-lang/josh-sync.
Rustc pull update
feat: Add Config Option to Exclude Locals from Document Symbol Search
...ber_to_resolve_ident_pat Fix "Implement default members" to resolve IdentPat
Switch from Chalk to the next trait solver
Add if..else completions in LetStmt and ArgList
Add guard to let-chain for replace_match_with_if_let
...else Fix indent for convert_match_to_let_else
Make import sorting order follow 2024 edition style
Enable warning logs by default
Ignore intrinsic calls in cross-crate-inlining cost model I noticed in a side project that a function which just compares to `[u64; 2]` for equality is not cross-crate-inlinable. That was surprising to me because I didn't think that code contained a function call, but of course our array comparisons are lowered to an intrinsic. Intrinsic calls don't make a function no longer a leaf, so it makes sense to add this as an exception to the "only leaves" cross-crate-inline heuristic. This is the useful compare link: https://perf.rust-lang.org/compare.html?start=7cb1a81145a739c4fd858abe3c624ce8e6e5f9cd&end=c3f0a64dbf9fba4722dacf8e39d2fe00069c995e&stat=instructions%3Au because it disables CGU merging in both commits, so effects that cause changes in the sysroot to perturb partitioning downstream are excluded. Perturbations to what is and isn't cross-crate-inlinable in the sysroot has chaotic effects on what items are in which CGUs after merging. It looks like before this PR by sheer luck some of the CGUs dirtied by the patch in eza incr-unchanged happened to be merged together, and with this PR they are not. The perf runs on this PR point to a nice runtime performance improvement.
improve c-variadic error reporting tracking issue: rust-lang/rust#44930 The parts of rust-lang/rust#143546 that don't require any particular knowledge about c-variadic functions. This prepares the way for rejecting c-variadic functions that are also coroutines, safe functions, or associated functions.
Migrate more things in the new solver to specific `DefId`s Continuation of rust-lang/rust#145377. I migrated the rest of the types, except aliases. Aliases are problematic because opaques and associated types share the same type in the new solver. `@jackh726,` `@lcnr,` `@ShoyuVanilla` I'd like to hear ideas here. Anyway, even if we do nothing with them we already got a substantial improvement. r? types
GVN: Ensure indirect is first projection in try_as_place. I haven't found any report for this bug on existing code, but managed to trigger it with rust-lang/rust#143333
rustc-dev-guide subtree update Subtree update of `rustc-dev-guide` to d03ffd4. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
Rollup of 7 pull requests Successful merges: - rust-lang/rust#146111 (Migrate more things in the new solver to specific `DefId`s) - rust-lang/rust#146298 (GVN: Ensure indirect is first projection in try_as_place.) - rust-lang/rust#146299 (docs(std): add error docs for path canonicalize) - rust-lang/rust#146310 (Allow static regions in `type_name`.) - rust-lang/rust#146313 (Some `rustc_middle` cleanups) - rust-lang/rust#146319 (Fix typo in default.rs) - rust-lang/rust#146320 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
eagerly compute `sub_unification_table` again Previously called `sub_relations`. We still only using them for diagnostics right now. This mostly reverts rust-lang/rust#119989. Necessary for type inference guidance due to not-yet defined opaque types, cc rust-lang/trait-system-refactor-initiative#182. We could use them for cycle detection in generalization and it seems desirable to do so in the future. However, this is unsound with the old trait solver as its cache does not track these `sub_unification_table` in any way. We now properly track the `sub_unification_table` when canonicalizing so using them in the new solver is totally sound and the performance impact is far more manageable than I thought back in rust-lang/rust#119989. r? `@compiler-errors`
Update tracing and fix binary regression Previous attempts (rust-lang/rust#127316, rust-lang/rust#134770) saw binary size regressions, this was root caused to <tokio-rs/tracing#2553> which changed the behavior of the `max_level_info` feature flag to match the docs (i.e., that flag only applies for debug builds and `release_max_level_info` applies for release builds). This change bumps the `tracing` version and sets both `max_level_info` and `release_max_level_info` when to match rustc's own `max_level_info`.
compiler: Add Windows resources to rustc-main and rustc_driver Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll Invokes `rc.exe` directly, rather than using one of the crates from the ecosystem to avoid adding dependencies. A new internal `rustc_windows_rc` crate has the common build script machinery for locating `rc.exe` and constructing the resource script
std: move `thread` into `sys` Part of rust-lang/rust#117276.
Skip typeck for items w/o their own typeck context Skip items which forward typeck to their ancestor. Should remove some potential but unnecessary typeck query waits, hence might improve performance for the parallel frontend. Thanks to `@ywxt` for a fix suggestion Fixes rust-lang/rust#141951
std: optimize `dlsym!` macro and add a test for it The `dlsym!` macro always ensures that the name string is nul-terminated, so there is no need to perform the check at runtime. Also, acquire loads are generally faster than a load and a barrier, so use them. This is only false in the case where the symbol is missing, but that shouldn't matter too much.
Keep space if arg does not follow punctuation when lint unused parens Fixes rust-lang/rust#138234 If the arg follows punctuation, still pass `left_pos` with `None` and no space will be added, else then pass `left_pos` with `Some(arg.span.lo())`, so that we can add the space as expected. And `emit_unused_delims` can make sure no more space will be added if the expr follows space. --- Edited: Directly use the `value_span` to check whether the expr removed parens will follow identifier or be followed by identifier.
update Readme add info about githooks and bootstrap.toml add info about config and remove linting specific files add link to rustc-dev-guide
fix(hover): unify horizontal rule formatting to `---`
libtest: expose --fail-fast as an unstable command-line option This exposes the `fail_fast` option added in rust-lang/rust#105153 on the test harness command line, so that workflows that only want to know if any test fails can find out without waiting for everything to run. For example, cargo-mutants just needs to know if any tests fails. It only works with `-Zunstable-options`. Tracking issue: rust-lang/rust#142859
...ratt Stabilize `btree_entry_insert` feature This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](rust-lang/rust#65225). New stable API: ```rust impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> { pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>; } impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> { pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>; } ``` (FCP ended almost a year ago, so if it's needed for process we could rerun it) Closes: rust-lang/rust#65225
...traviscross don't apply temporary lifetime extension rules to non-extended `super let` Reference PR: rust-lang/reference#1980 This changes the semantics for `super let` (and macros implemented in terms of it, such as `pin!`, `format_args!`, `write!`, and `println!`) as suggested by ````@theemathas```` in rust-lang/rust#145784 (comment), making `super let` initializers only count as [extending expressions](https://doc.rust-lang.org/nightly/reference/destructors.html#extending-based-on-expressions) when the `super let` itself is within an extending block. Since `super let` initializers aren't temporary drop scopes, their temporaries outside of inner temporary scopes are effectively always extended, even when not in extending positions; this only affects two cases as far as I can tell: - Block tail expressions in Rust 2024. This PR makes `f(pin!({ &temp() }))` drop `temp()` at the end of the block in Rust 2024, whereas previously it would live until after the call to `f` because syntactically the `temp()` was in an extending position as a result of `super let` in `pin!`'s expansion. - `super let` nested within a non-extended `super let` is no longer extended. i.e. a normal `let` is required to treat `super let`s as extending (in which case nested `super let`s will also be extending). Closes rust-lang/rust#145784 This is a breaking change. Both static and dynamic semantics are affected. The most likely breakage is for programs to stop compiling, but it's technically possible for drop order to silently change as well (as in rust-lang/rust#145784). Since this affects stable macros, it probably would need a crater run. Nominating for discussion alongside rust-lang/rust#145784: ````@rustbot```` label +I-lang-nominated +I-libs-api-nominated Tracking issue for `super let`: rust-lang/rust#139076
Suggest removing Box::new instead of unboxing it
Add tidy readme This PR adds a Readme to `src/tools/tidy`. Basically just explains how `tidy` works and covers all of tidy's checks, directives, and how to use tidy. I tried to add a bit more detail on some of the options like `--extra-checks` and the style directives that aren't really documented well elsewhere. Planning to link to this in the dev guide. Closes: rust-lang/rust#129368
StateTransform: Do not renumber resume local. MIR parameters are not explicitly assigned-to when entering the MIR body. If we want to save their values inside the coroutine state, we need to do so explicitly. This was done by renaming the `_2` local, and introducing an explicit assignment pre-transform. This particular trick confuses me. This version makes explicit that we are assigning parameters to saved locals. r? ``@dingxiangfei2009``
Remove Rvalue::Len again. Now that we have `RawPtrKind::FakeForPtrMetadata`, we can reimplement `Rvalue::Len` using `PtrMetadata(&raw const (fake) place)`. r? ``@scottmcm``
Detect attempt to use var-args in closure ``` error: unexpected `...` --> $DIR/no-closure.rs:11:14 | LL | let f = |...| {}; | ^^^ not a valid pattern | = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: unexpected `...` --> $DIR/no-closure.rs:16:17 | LL | let f = |_: ...| {}; | ^^^ | = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list ``` Fix rust-lang/rust#146489, when trying to use c-style var-args in a closure. We emit a more targeted message. We also silence inference errors when the pattern is `PatKind::Err`.
...ouxu tests/run-make: Update list of statically linked musl targets All of the tier 3 targets in the list now link dynamically by default (except `mips64el-unknown-linux-muslabi64`, I apparently overlooked that one in my PR that changed this). Adjust the list of targets expected to link statically accordingly. See also rust-lang/rust#144410, which changed these targets. Target by target: - `mips64-unknown-linux-musl`: this target does not exist AFAICT - `mips64-unknown-linux-muslabi64`: updated in the linked PR - `powerpc-unknown-linux-musl`: updated in the linked PR - `powerpc-unknown-linux-muslspe`: updated in the linked PR - `powerpc64-unknown-linux-musl`: updated in the linked PR - `riscv32gc-unknown-linux-musl`: updated in the linked PR - `s390x-unknown-linux-musl`: updated in the linked PR - `thumbv7neon-unknown-linux-musleabihf`: updated in the linked PR
cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 3) - Part of rust-lang/rust#134001 - Follow-up to rust-lang/rust#136375 - Follow-up to rust-lang/rust#136632 --- This is another batch of LLVMDIBuilder binding migrations, replacing some our own LLVMRust bindings with bindings to upstream LLVM-C APIs. This PR migrates all of the bindings that were touched by rust-lang/rust#136632, plus `LLVMDIBuilderCreateStructType`.
Rollup of 14 pull requests Successful merges: - rust-lang/rust#142807 (libtest: expose --fail-fast as an unstable command-line option) - rust-lang/rust#144871 (Stabilize `btree_entry_insert` feature) - rust-lang/rust#145071 (Update the minimum external LLVM to 20) - rust-lang/rust#145181 (remove FIXME block from `has_significant_drop`, it never encounters inference variables) - rust-lang/rust#145660 (initial implementation of the darwin_objc unstable feature) - rust-lang/rust#145838 (don't apply temporary lifetime extension rules to non-extended `super let`) - rust-lang/rust#146259 (Suggest removing Box::new instead of unboxing it) - rust-lang/rust#146410 (Iterator repeat: no infinite loop for `last` and `count`) - rust-lang/rust#146460 (Add tidy readme) - rust-lang/rust#146552 (StateTransform: Do not renumber resume local.) - rust-lang/rust#146564 (Remove Rvalue::Len again.) - rust-lang/rust#146581 (Detect attempt to use var-args in closure) - rust-lang/rust#146588 (tests/run-make: Update list of statically linked musl targets) - rust-lang/rust#146631 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 3)) r? `@ghost` `@rustbot` modify labels: rollup
Enable DestinationPropagation by default This PR proposes to perform destination propagation on MIR. Most of the pass was fully rewritten by `@JakobDegen` in rust-lang/rust#96451. This pass is quite heavy, as it needs to perform and save the results of a full liveness dataflow analysis. This accounts for ~50% of the pass' runtime. Perf sees a few decent savings in later llvm passes, but also sizeable régressions when there are no savings to balance this pass' runtime.
interpret: copy_provenance: avoid large intermediate buffer for large repeat counts Copying provenance worked in this odd way where the "preparation" phase (which is supposed to just extract the necessary information from the source range) already did all the work of repeating the result N times for the target range. This was needed to use the existing `insert_presorted` function on `SortedMap`. This PR generalizes `insert_presorted` so that we can avoid this odd structure on copy-provenance, and maybe even improve performance.
Fix `env::ArgsOs` for zkVM The zkVM implementation of `env::ArgsOs` incorrectly reports the full length even after having iterated. Instead, use a range approach which works out to be simpler. Also, implement more iterator methods like the other platforms in #139847. cc `@flaub` `@jbruestle` `@SchmErik`
Prevent ABI changes affect EnzymeAD This PR handles ABI changes for autodiff input arguments to improve Enzyme compatibility. Fundamentally this adjusts activities when a function argument is lowered as an `ScalarPair`, so there's no mismatch between diff activities and args. Also removes activities corresponding to ZSTs. fixes: rust-lang/rust#144025 r? `@ZuseZ4`
`-Znext-solver` allow `ExprKind::Call` for not-yet defined opaques Based on rust-lang/rust#146329. Revival of rust-lang/rust#140496. See the comment on `OpaqueTypesJank`. I've used the following document while working on this https://hackmd.io/Js61f8PRTcyaiyqS-fH9iQ. Fixes rust-lang/trait-system-refactor-initiative#181. It does introduce one subtle footgun we may want to handle before stabilization, opened rust-lang/trait-system-refactor-initiative#230 for that. Also cc rust-lang/trait-system-refactor-initiative#231 for deref and index operations r? `@BoxyUwU`
GVN: stop hashing opaque values GVN generates values that are not meant to be unified with any other. For instance `Opaque` (aka we don't know anything), non-deterministic constants and borrows. The current algorithm generates a unique index, so the generated `Value` will be different from all the existing. This is wasteful, as we should not hash that `Value` at all. This PR proposes to do this. This involves partially reimplementing a `FxIndexSet`, but yields a small but consistent perf improvement (rust-lang/rust#145737 (comment)).
Make `PeekMut` generic over the allocator - plumb in allocator generic - additional testing Related: rust-lang/rust#122742
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@0c62c01. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
Fix and provide instructions for running test suite on Apple simulators The following now works: ```sh ./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo ./x test --host='' --target aarch64-apple-tvos-sim --skip tests/debuginfo ./x test --host='' --target aarch64-apple-watchos-sim --skip tests/debuginfo ./x test --host='' --target aarch64-apple-visionos-sim --skip tests/debuginfo ``` I have documented the setup I used [in the `rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/tests/running.html#testing-on-emulators), it's fairly standard use of `remote-test-server` (with a small fix to library load paths which I've made in the first commit). I first tried the somewhat simpler `target.aarch64-apple-ios-sim.runner = "xcrun simctl spawn $UDID"`, but that doesn't work as required libraries etc. also need to be copied to the device. The debuginfo tests fail, I think because the debug info in `.dSYM` isn't available. I am yet unsure exactly how to fix this, either we need to copy that directory to the target as well, or we need to configure `lldb` somehow to read it from the host. I decided to not add this to our CI, since I suspect we wouldn't gain much from it? Running on the simulator still uses the host Darwin kernel, it's basically just configured to run in another mode with more restricted permissions and different system libraries. r? jieyouxu CC ``@simlay,`` you're a lot more familiar with `xcrun simctl` than I.
fixes for numerous clippy warnings
Allow running `x <cmd> <path>` from a different directory Fixes: rust-lang/rust#146772 r? ``@jieyouxu``
Fix unsupported `std::sys::thread` after move Fixes building std for any platform with an unsupported thread abstraction. This includes {aarch64,armv7,x86_64}-unknown-trusty and riscv32im-risc0-zkvm-elf, which explicitly include the unsupported module, and platforms with no PAL. Bug fix for rust-lang/rust#145177 (std: move thread into sys). Also fix the `std` build for xtensa, which I incidentally found while looking for an unsupported platform. r? ``@joboet``
Rollup of 5 pull requests Successful merges: - rust-lang/rust#144592 (generate list of all variants with `target_spec_enum`) - rust-lang/rust#146762 (Fix and provide instructions for running test suite on Apple simulators) - rust-lang/rust#146770 (fixes for numerous clippy warnings) - rust-lang/rust#146774 (Allow running `x <cmd> <path>` from a different directory) - rust-lang/rust#146800 (Fix unsupported `std::sys::thread` after move) r? `@ghost` `@rustbot` modify labels: rollup
...ol,jieyouxu Ignore tests in `tests/ui/abi` for the GCC backend Needed for rust-lang/rust#146414. Currently we ignore them in the GCC backend and until this situation changes, it'll block rust-lang/rust#146414. r? `@Kobzol`
Consider errors in MIR as impossible predicates to empty the body. The ICEs come from elaborating drops or performing state transform in MIR bodies that fail typeck or borrowck. If the body is tainted, replace it with `unreachable`. Fixes rust-lang/rust#122630 Fixes rust-lang/rust#122904 Fixes rust-lang/rust#125185 Fixes rust-lang/rust#139556
This updates the rust-version file to 9f32ccf35fb877270bc44a86a126440f04d676d0.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 9f32ccf35fb877270bc44a86a126440f04d676d0 Filtered ref: 87b1377 Upstream diff: rust-lang/rust@2f3f27b...9f32ccf This merge was created using https://github.com/rust-lang/josh-sync.
Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide
or r? <username>
.
@rustbot
rustbot
added
the
S-waiting-on-review
Status: this PR is waiting for a reviewer to verify its content
label
Sep 22, 2025
@rustbot
rustbot
removed
the
S-waiting-on-review
Status: this PR is waiting for a reviewer to verify its content
label
Sep 22, 2025
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.