Skip to content

Rustc pull update #2539

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 56 commits into from
Aug 7, 2025
Merged

Rustc pull update #2539

merged 56 commits into from
Aug 7, 2025

Conversation

workflows-rustc-dev-guide[bot]
Copy link

Latest update from rustc.

lnicola and others added 30 commits July 21, 2025 09:18
fix: Disable tests in flycheck if `cfg.setTest` is set to false
Migrate `generate new` assist to use `SyntaxEditor`
Migrate AstNodeEdit::Indent to SyntaxEditor
Add ide-assist: generate_impl_trait for generate_impl
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 733dab558992d902d6d17576de1da768094e2cf3
Filtered ref: 8f0faf94fb41d4e2a85ef2d23e5495f6bea1f31d

This merge was created using https://github.com/rust-lang/josh-sync.
Fix gen panics doc template for debug_assert
fix: Do not require all rename definitions to be renameable
fix: In generate_mut_trait_impl, don't add a tabstop if the client does not support snippets
Improve settings tree title and descriptions
fix: When displaying a projection into a type parameter that has bounds as `impl Trait`, collect only the bounds of this projection
…_to_named_struct

Migrate `convert_tuple_struct_to_named_struct` assist to use `SyntaxEditor`
…_syntax_editor

Migrate `inline_type_alias` assist to use `syntax_editor`
Co-authored-by: Tshepang Mbambo <[email protected]>
Reorganize proc-macro-srv more, add `--format` and `--version` args
…s, r=GuillaumeGomez

rustdoc template font links only emit `crossorigin` when needed

The `crossorigin` attribute may cause issues when the href is not actually cross-origin. Specifically, the tag causes the browser to send a preflight OPTIONS request to the server even if it is same-origin. Some temperamental servers may reject all CORS preflight requests even if they're actually same-origin, which causes a CORS error and prevents the fonts from loading, even later on.

This commit fixes that problem by not emitting `crossorigin` if the url appears to be relative to the same origin.
Rehome 21 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`

rust-lang/rust#143902 divided into smaller, easier to review chunks.

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that ``@Kivooeo`` was using.

r? ``@jieyouxu``
fix: Error on illegal `[const]`s inside blocks within legal positions

Fixes rust-lang/rust#132067

I initially considered moving `[const]` validations to `rustc_ast_lowering`, but that approach would require adding constness information to `AssocCtxt`, which introduces significant changes - especially within `rustc_expand` - just to support a single use case here:

https://github.com/rust-lang/rust/blob/3fb1b53a9dbfcdf37a4b67d35cde373316829930/compiler/rustc_ast_passes/src/ast_validation.rs#L1596-L1610

Instead, I believe it's sufficient to simply "reset" `[const]` allowness whenever we enter a new block.
`Printer` cleanups

The trait `Printer` is implemented by six types, and the sub-trait `PrettyPrinter` is implemented by three of those types. The traits and the impls are complex and a bit of a mess. This PR starts to clean them up.

r? ``@davidtwco``
Implement debugging output of the bootstrap Step graph into a DOT file

There are already a bunch of ways how we can debug bootstrap, so why not add one more =D (ideally I'd like to consolidate these approaches somewhat, ```@Shourya742``` is looking into that, but I think that this specific debugging tool is orthogonal to the rest of them, and is quite useful).

This PR adds the option to render the bootstrap step graph into the DOT format, in order to understand what steps were executed, along with their fields (`Debug` output).

Here you can see an example of the generated DOT files for the `BOOTSTRAP_TRACING=1 ./x build compiler --stage 2 --dry-run` command on x64 Linux. One is with cached deps (what this PR does), the other one without.

[bootstrap-dot.zip](https://github.com/user-attachments/files/21548679/bootstrap-dot.zip)

Visual example:
<img width="1899" height="445" alt="image" src="https://github.com/user-attachments/assets/ae40e6d2-0ea8-48bb-b77e-6b21700b95ee" />

r? ```@jieyouxu```
Add a tidy check to prevent adding UI tests directly under `tests/ui/`

This PR implements rust-lang/compiler-team#902.

Only the last commit (adding the new check) is functional; earlier commits are just small drive-by changes to make the other ui/ui-fulldeps checks more logically contained.

r? ```@Kobzol``` (or compiler)
Properly reject tail calls to `&FnPtr` or `&FnDef`

Fixes rust-lang/rust#144795
Rename `rust_panic_without_hook` to `resume_unwind`

part of rust-lang/rust#116005

r? libs
…mann

Remove `SHOULD_EMIT_LINTS` in favor of `should_emit`

r? ``@jdonszelmann``
Use `as_array` in PartialEq for arrays

Now that `as_array` exists we might as well use it here, since it's a bit more convenient than getting the correct type out of `try_into`.
Document Poisoning in `LazyCell` and `LazyLock`

Currently, there is no documentation of poisoning behavior in either `LazyCell` or `LazyLock`, even though both of them can be observed as poisoned by users.

`LazyCell` [plagyround example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=9cf38b8dc56db100848f54085c2c697d)

`LazyLock` [playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=f1cd6f9fe16636e347ebb695a0ce30c0)

# Open Questions

- [x] Is it worth making the implementation of `LazyLock` more complicated to ensure that the the panic message is `"LazyLock instance has previously been poisoned"` instead of `"Once instance has previously been poisoned"`? See the `LazyLock` playground link above for more context.
- [x] Does it make sense to move `LazyLock` into the `poison` module? It is certainly a poison-able type, but at the same time it is slightly different from the 4 other types currently in the `poison` module in that it is unrecoverable. I think this is more of a libs-api question.

``@rustbot`` label +T-libs-api

Please let me know if these open questions deserve a separate issue / PR!
samueltardieu and others added 26 commits August 5, 2025 03:51
coverage: Various small cleanups

This PR is a collection of small coverage-related changes that I accumulated while working towards other coverage improvements.

Each change should hopefully be fairly straightforward.
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@8d75311.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
Add `InterpCx::project_fields`

I was hoping for a much bigger improvement and this is lukewarm at best ^^'

Still, I think this makes sense.
Delete `tests/ui/threads-sendsync/tcp-stress.rs`

This stress test was originally introduced in 65cca4bd3fa0abe1000662014b3e3ea1420728f5 to detect a UAF in `libuv` (see rust-lang/rust#12823), but we no longer use `libuv`, so remove this test as it no longer serves its original purpose, and is causing flaky timeout failures.

Closes rust-lang/rust#144878 (by removing the test).

r? libs
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 1263fc2.

Created using https://github.com/rust-lang/josh-sync.

r? ``@ghost``
Dont print arg span in MIR dump for tail call

r? WaffleLapkin

This makes the MIR dump for tail call terminators consistent w/ regular calls.
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#144467 (rustdoc template font links only emit `crossorigin` when needed)
 - rust-lang/rust#144548 (Rehome 21 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#144741 (fix: Error on illegal `[const]`s inside blocks within legal positions)
 - rust-lang/rust#144776 (`Printer` cleanups)
 - rust-lang/rust#144779 (Implement debugging output of the bootstrap Step graph into a DOT file)
 - rust-lang/rust#144813 (Add a tidy check to prevent adding UI tests directly under `tests/ui/`)
 - rust-lang/rust#144817 (Properly reject tail calls to `&FnPtr` or `&FnDef`)
 - rust-lang/rust#144852 (Rename `rust_panic_without_hook` to `resume_unwind` )
 - rust-lang/rust#144866 (Remove `SHOULD_EMIT_LINTS` in favor of `should_emit`)
 - rust-lang/rust#144867 (Use `as_array` in PartialEq for arrays)
 - rust-lang/rust#144872 (Document Poisoning in `LazyCell` and `LazyLock`)
 - rust-lang/rust#144877 (coverage: Various small cleanups)
 - rust-lang/rust#144887 (`rust-analyzer` subtree update)
 - rust-lang/rust#144890 (Add `InterpCx::project_fields`)
 - rust-lang/rust#144894 (Delete `tests/ui/threads-sendsync/tcp-stress.rs`)
 - rust-lang/rust#144905 (rustc-dev-guide subtree update)
 - rust-lang/rust#144920 (Dont print arg span in MIR dump for tail call)

r? `@ghost`
`@rustbot` modify labels: rollup
Consolidate staging for `rustc_private` tools

This PR continues bootstrap refactoring, this time by consolidating staging for `Mode::ToolRustc` tools. This refactoring was in the critical path of refactoring `test`/`dist`/`clippy`/`doc` steps, and getting rid of the rmeta/rlib sysroot copy, because tools are pervasive and they are being used for a lot of things in bootstrap.

The main idea is to explicitly model the fact that a stage N `Mode::ToolRustc` tool always works with two different compilers:
- Stage N-1 rustc (`build_compiler`) builds stage N rustc (`target_compiler`)
- Rlib artifacts from stage N rustc are copied to the sysroot of stage N-1 rustc
- Stage N-1 rustc builds the (stage N) tool itself, the tool links to the rlib artifacts of the stage N rustc

Before, the code often used `compiler`, which meant sometimes the build compiler, sometimes the target compiler, and sometimes neither (looking at you, `download-rustc`). This is especially annoying when you get to a situation where you have an install step that invokes a dist step that invokes a tool build step, where *some* compiler is being propagated through, without it being clear what does that compiler represent. This refactoring hopefully makes that clearer and more explicit. It also gets rid of a few `builder.ensure(Rustc(...))` calls within bootstrap, which is always nice.

`Rustdoc` needs to be handled a bit specially, because it acts as a compiler itself, I documented that in the changes.

It wasn't practical to do these refactorings in multiple PRs, so I did it all in one PR. The meat of the change is 9ee6d1c1ed112c3dcfb5684b33772b136df0dca3.

I tested manually that `x build rustdoc` and `x build miri` still works even with `download-rustc`, although I cannot promise any extra support for `download-rustc`, IMO we will just have to reimplement it from scratch in a different way.

As usually, I did some drive-by refactorings to bootstrap, trying to document and clarify things, add more step metadata and tests.

Since these changes broke Cargo, which was incorrectly using `Mode::ToolRustc`, I also changed cargo to `ToolTarget` in this PR.

Best reviewed commit-by-commit (note that I renamed `link_compiler` to `target_compiler`, in accordance to the rest of bootstrap, in the last commit).

r? `@jieyouxu`

try-job: x86_64-gnu-aux
try-job: x86_64-msvc-ext1
Simplify dead code lint

This PR scratches a few itches I had when looking at that code.

The perf improvement comes from keeping the `scanned` set through several marking phases. This pretty much divides by 2 the number of HIR traversals.
Update to LLVM 21

Timeline: LLVM 21.1.0 is scheduled to release on Aug 26th. Rust 1.90 branches on Aug 1st and releases September 18.

Depends on:
 * [x] llvm/llvm-project#147781
 * [x] llvm/llvm-project#147935
 * [x] llvm/llvm-project#139443
 * [x] llvm/llvm-project#148207
 * [x] llvm/llvm-project#148607
 * [x] llvm/llvm-project#149046
 * [x] llvm/llvm-project#149097
 * [x] rust-lang/rust#144116

r? `@ghost`
Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`

rust-lang/rust#143902 divided into smaller, easier to review chunks.

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that ``@Kivooeo`` was using.

r? ``@jieyouxu``
Add documentation for unstable_feature_bound

There is more detail and explanation in https://hackmd.io/``````@tiif/Byd3mq7Ige``````

Original PR that implemented this: rust-lang/rust#140399

r? ``````@BoxyUwU`````` to nominate for types team discussion
Change visibility of Args new function

Currently the Args new function is constrained to pub(super) but this stops me from being able to construct Args structs in unit tests.

This pull request is to change this to pub.
[rustdoc] Fix wrong `i` tooltip icon

Current wrong display:

<img width="334" height="37" alt="Screenshot From 2025-08-04 17-42-38" src="https://github.com/user-attachments/assets/57046475-6162-487f-998f-ebb2434c111d" />

With the fix:

<img width="334" height="37" alt="image" src="https://github.com/user-attachments/assets/e761a103-dc39-4e30-8c8e-cfc7fab52fde" />

r? ``@fmease``
…nt, r=clubby789

compiletest: add hint for when a ui test produces no errors
Correct the use of `must_use` on btree::IterMut

I'm working on stricter target checking for attributes and found this one
Drop `rust-version` from `rustc_thread_pool`

The current `rust-version = "1.63"` was inherited from rayon, but it
doesn't make sense to limit this in the compiler workspace. Having any
setting at all has effects on tools like `cargo info` that try to infer
the MSRV when the workspace itself doesn't specify it. Since we are the
compiler, our only MSRV is whatever bootstrapping requires.
Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`

mrrrow~
run-make: Allow blessing snapshot files that don't exist yet

This makes it possible to bless the snapshot files used by `diff()` in newly-created run-make tests, without having to create the files manually beforehand.

r? jieyouxu
num: Rename `isolate_most_least_significant_one` functions

Tracking issue - rust-lang/rust#136909

libs-api has agreed to rename these unstable functions to `isolate_highest_one`/`isolate_lowest_one`
rust-lang/rust#136909 (comment)

`isolate_most_significant_one` -> `isolate_highest_one`
`isolate_least_significant_one` -> `isolate_lowest_one`
Fix some doc links for intrinsics

This fixes a few intrinsic docs that had a link directly to itself instead of to the correct function in the `mem` module.
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#144552 (Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#144676 (Add documentation for unstable_feature_bound)
 - rust-lang/rust#144836 (Change visibility of Args new function)
 - rust-lang/rust#144910 (Add regression tests for seemingly fixed issues)
 - rust-lang/rust#144913 ([rustdoc] Fix wrong `i` tooltip icon)
 - rust-lang/rust#144924 (compiletest: add hint for when a ui test produces no errors)
 - rust-lang/rust#144926 (Correct the use of `must_use` on btree::IterMut)
 - rust-lang/rust#144928 (Drop `rust-version` from `rustc_thread_pool`)
 - rust-lang/rust#144945 (Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`)
 - rust-lang/rust#144954 (run-make: Allow blessing snapshot files that don't exist yet)
 - rust-lang/rust#144971 (num: Rename `isolate_most_least_significant_one` functions)
 - rust-lang/rust#144978 (Fix some doc links for intrinsics)

r? `@ghost`
`@rustbot` modify labels: rollup
Add release notes for 1.89.0

r? `@BoxyUwU`
cc `@rust-lang/release`
`@rustbot` ping relnotes-interest-group
This updates the rust-version file to 6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd
Filtered ref: 6cc4ce7

This merge was created using https://github.com/rust-lang/josh-sync.
@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2025

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 Aug 7, 2025
@tshepang tshepang merged commit 1beca63 into master Aug 7, 2025
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants