Skip to content

Rustc pull update#2885

Merged
tshepang merged 42 commits into
mainfrom
rustc-pull
May 30, 2026
Merged

Rustc pull update#2885
tshepang merged 42 commits into
mainfrom
rustc-pull

Conversation

@workflows-rustc-dev-guide
Copy link
Copy Markdown

Latest update from rustc.

Amanieu and others added 30 commits April 18, 2026 07:53
ci: use `macos-15-intel` runner
Add AMX-AVX512 BF16 intrinsics
loongarch: Use `intrinsics::simd` for selected LSX/LASX intrinsics
mark `vstl1_*` functions as unsafe
loongarch: Refactor portable SIMD helper naming and intrinsic paths
Revert changing number of passes depending on number of parameters
Clarify UTF-16 decoding errors

Fix UTF-16 error messages as suggested in rust-lang/rust#116258.
Privacy: try use queue instead of fixed-point iteration



Earlier: iterate until updates of `EffectiveVisibility` occur.

Now:  if an update occurs, then we put in the queue those items that may be affected by this update. Iterate until there are items in the queue.

r? @petrochenkov
Make bitset `would_modify_words` more vectorizer-friendly



Currently this function compares a single pair of `u64` at a time, which is potentially slower than comparing multiple words before each early-exit check, especially for the large chunks used by ChunkedBitSet.

Perf shows a notable improvement in `cranelift-codegen`, which is the one benchmark that is known to stress these code paths.

- Incorporates rust-lang/rust#153759.
Revert tearing changes to `dbg!`

Since the primary change to `dbg!` in rust-lang/rust#149869, we've been chasing a few regressions:

* rust-lang/rust#153850, fixed by rust-lang/rust#154074
* rust-lang/rust#154988, fixed by rust-lang/rust#154994
* rust-lang/rust#155902, proposed fix in rust-lang/rust#155915

We already reverted this once, on beta only to prevent these regressions from shipping in 1.95.

In that most recent PR, we decided that it would be better to revert `dbg!` to its original state everywhere (`main` and 1.96-`beta`), and then we can consider it from scratch later. So here I've reverted the change and its fixes, but kept the regression tests, including the pending one.

cc @joboet @dianne @rust-lang/libs 
@rustbot label beta-nominated
…GuillaumeGomez

Stabilize `--remap-path-prefix` in rustdoc



# Stabilization report of  `--remap-path-prefix` in rustdoc

## Summary

`rustc` supports remapping source paths prefixes as a best effort in all compiler generated output, including compiler diagnostics, debugging information, macro expansions, documentation, doctests, etc.

This is useful for normalizing build products, for example, by removing the current directory out of the paths emitted into object files.

This stabilization stabilize the same flag used by `rustc` in `rustdoc`.

There are no tracking issue.

Stabilization was discussed at the last meeting, [#t-rustdoc/meetings > 2026-04-13 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/393423-t-rustdoc.2Fmeetings/topic/2026-04-13/near/585264347).

### What is stabilized

The rustdoc `--remap-path-prefix` flag is being stabilized by this PR. (It's equivalent to rustc flag)

It permits remapping (as a best effort) source path prefixes in all output, including diagnostics, debug information, macro expansions, generated documentation, etc.

It takes a value of the form `FROM=TO` where a path prefix equal to `FROM` is rewritten to the value `TO`.

#### Example

```sh
rustdoc src/lib.rs --remap-path-prefix="$PWD=/foo"
```

### What isn't stabilized

Neither `--remap-path-scope` (~~soon to be added as unstable in `rustdoc`~~ rust-lang/rust#155451) or the already unstable in `rustc` `documentation` scope are being stabilized or added here.

## Design

### Implementation history

- rust-lang/rust#107099

### Unresolved questions

There are no unresolved questions.

### Post-implementation changes

The implementation has evolved with `rustc`, but no changes to the flag it-self have been made.

### Nightly extensions

The `documentation` scope, which currently can only be set from `rustc`, as we need to add an equivalent to the `--remap-path-scope` flag, ~~which is planned~~ (EDIT: rust-lang/rust#155451), but not required, the current `--remap-path-prefix` defaults to the `all` scope, like `rustc`.

### Doors closed

We are committing to having to having a flag that permits remapping paths. The compiler team already made the same commitment.

## Feedback

### Call for testing

No call for testing has been done.

### Nightly use

Unable to determine. A [GitHub search](https://github.com/search?q=%20%2F--remap-path-prefix%2F&type=code) only seems to only reveals the `rustc` usage (over 6k though).

Rust-for-Linux is using the [flag](https://github.com/torvalds/linux/blob/e80d033851b3bc94c3d254ac66660ddd0a49d72c/Makefile#L1151-L1153).

## Implementation

### Major parts

- rust-lang/rust#107099
- rust-lang/rust#149709
- rust-lang/rust#150172
- rust-lang/rust#151589

### Coverage

- [`tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.rs)
- [`tests/rustdoc-ui/remap-path-prefix-invalid-doctest.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-ui/remap-path-prefix-invalid-doctest.rs)
- [`tests/rustdoc-ui/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-ui/remap-path-prefix-macro.rs)
- [`tests/rustdoc-ui/remap-path-prefix-passed-doctest-output.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-ui/remap-path-prefix-passed-doctest-output.rs)
- [`tests/rustdoc-ui/lints/remap-path-prefix-lint.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-ui/lints/remap-path-prefix-lint.rs)
- [`tests/rustdoc-html/import-remapped-paths.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-html/import-remapped-paths.rs)
- [`tests/rustdoc-html/macro/external-macro-src.rs`](https://github.com/rust-lang/rust/blob/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96/tests/rustdoc-html/macro/external-macro-src.rs)

### Outstanding bugs

There are no outstanding bugs regarding `--remap-path-prefix` in `rustdoc`.

There are [caveats and limitation](https://doc.rust-lang.org/nightly/rustc/remap-source-paths.html#caveats-and-limitations) in `rustc`, but they mostly concern generated object files, which we don't really have. 

### Outstanding FIXMEs

There are no FIXME regarding `--remap-path-prefix`.

## Acknowledgments

- @edward-shen
- @Urgau
Use strongly typed wrapped indices in `VecDeque`



This is far from perfect, but it would have prevented rust-lang/rust#151769.

r? @joboet
The `needs-asm-mnemonic` directive was very general, but in practice was only
being used for `ret`. There are very few other mnemonics that it could
plausibly be useful for (e.g. `nop`), because any instruction that requires
arguments is probably going to be non-portable.

This PR replaces `needs-asm-mnemonic` with a simpler `needs-asm-ret` directive
that uses the same machinery as other simple needs directives.

If we happend to need more mnemonics in the future, we can just add more simple
directives as appropriate (e.g. `needs-asm-nop`).
Replace rustfmt code of conduct with link

In rust-lang/rust#65141 we replaced the CoC file and linked the "authoritative source" on the website. I noticed that the rustfmt directory still has the CoC original file.

I *think* for consistency it makes sense to have all of them linked but I'd like to hear from @calebcartwright first :-)

r? @Mark-Simulacrum
compiletest: Simplify `//@ needs-asm-mnemonic: ret` to just `//@ needs-asm-ret`

- Simplification of rust-lang/rust#155692.
---

The `needs-asm-mnemonic` directive was very general, but in practice was only being used for `ret`. There are very few other mnemonics that it could plausibly be useful for (e.g. `nop`), because any instruction that requires arguments is probably going to be non-portable.

This PR replaces `needs-asm-mnemonic` with a simpler `needs-asm-ret` directive that uses the same machinery as other simple needs directives.

If we happend to need more mnemonics in the future, we can just add more simple directives as appropriate (e.g. `needs-asm-nop`).
…uwer

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#156862 (Convert strict_provenance_lints to late lint passes)
 - rust-lang/rust#156879 (Replace rustfmt code of conduct with link)
 - rust-lang/rust#156901 (compiletest: Simplify `//@ needs-asm-mnemonic: ret` to just `//@ needs-asm-ret`)
Add CI check when building sysroot with GCC backend and running libcore tests with it



Fixes rust-lang/rustc_codegen_gcc#882.

Is it what you had in mind @Kobzol?

r? @Kobzol
…ochenkov

delegation: remove method call generation

This PR removes method call generation from delegations, now we always generate default call. Part of rust-lang/rust#118212.

We reuse methods probing engine for finding needed adjustments, thus extending number of supported cases. In this PR adjustments are applied to trait methods (was supported before) ~and static functions (new feature)~. Free functions can be supported later.

Finally this PR solves issues from parent generics propagation from rust-lang/rust#155906.

r? @petrochenkov
rustc_on_unimplemented: introduce format specifiers

...as printing options for the annotated item.

See also the test and dev guide prose. This only affects rustc_on_unimplemented, not (yet) the other diagnostic attributes. I plan to do that in some later PR.

```rust
#![feature(rustc_attrs)]

#[rustc_on_unimplemented(
    message = "normal: {This}, path: {This:path},  resolved: {This:resolved}"
)]
pub trait Trait<'lifetime, const CONST_GENERIC: usize, A, B> where A: Send {}
```
will do:
```
normal: Trait, path: Trait<'lifetime, CONST_GENERIC, A, B>,  resolved: Trait<'_, 6, u8, _>
```
fix E0371 description

This changes the `impl`s to be `impl {Trait} for dyn {Trait}` instead of just `impl {Trait} for {Trait}` in the description of E0371.

(While this was not part of "Crafting errors like rustc" workshop at RustWeek by @jdonszelmann and @estebank, I found this while going through all errors Rust emits to pick a favourite)
JonathanBrouwer and others added 12 commits May 26, 2026 13:42
tidy: remove duplicate entry and alphabetize OS constants list
Drop skip_move_check_fns query.

Looking at the header of the impl block for each method can be just as fast.
fix breakpoint callback registration in `lldb_batchmode`

We'd been failing to register the callback for a while now, because it couldn't find the specified function. This change imports `lldb_batchmode` and uses the namespaced name of the function.

As an aside, I'm relatively sure this breakpoint callback isn't necessary anymore. Whenever lldb stops at a breakpoint, it updates the selected thread/frame automatically. I don't want to remove it quite yet because I *might* need it for some bookkeeping with the `lldb-repr` directive (and `--bless` behavior)
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156959 (stdarch subtree update)
 - rust-lang/rust#156541 (delegation: remove method call generation)
 - rust-lang/rust#156161 (rustc_on_unimplemented: introduce format specifiers)
 - rust-lang/rust#156752 (fix E0371 description)
 - rust-lang/rust#156761 (tidy: remove duplicate entry and alphabetize OS constants list)
 - rust-lang/rust#156872 (Drop skip_move_check_fns query.)
 - rust-lang/rust#156899 (fix breakpoint callback registration in `lldb_batchmode`)
 - rust-lang/rust#156927 (Reorganize `tests/ui/issues` [1/N])
 - rust-lang/rust#156947 (Update mdbook to 0.5.3)
std::net::tcp: let the OS pick the port numbers



See rust-lang/rust#156377 for context.
I only did the TCP tests for now to see whether there are any unexpected problems.
Merge several HIR-level queries into one



Now four queries (`local_def_id_to_hir_id`, `opt_hir_owner_nodes`, `opt_ast_lowering_delayed_lints`, `in_scope_traits_map`) were replaced with regular methods which acts like getters. 
An `hir_owner` query was added that returns a `ProjectedMaybeOwner` that contains all those fields. `hir_attr_map` remains a separate query as adding attributes to `ProjectedMaybeOwner` led to [perf regressions](rust-lang/rust#155678 (comment)). 
There is a similar issue with `in_scopes_trait_map`, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from `opt_hir_owner_nodes` -> `hir_owner`, but there are few cases when new dirty queries were added.

r? @petrochenkov
r? @oli-obk
compiler-builtins subtree update

Subtree update of `compiler-builtins` to rust-lang/compiler-builtins@8bf3293.

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

r? @ghost
…boet

lib: specialize Clone of array IntoIter



This PR adds the `TrivialClone` specialization to the `PolymorphicIter` type, which `array::IntoIter` uses. I also added another coretest for the default case (already existing test catches the specialized one).

There are no unwinding concerns since `TrivialClone` means cloning = copying and we never call `Clone::clone`.

`array:IntoIter` is being used on a lot of places in both `core` and in user code, and `array::IntoIter` (nor does its users) override `Clone` often and just delegate to the inner type `PolymorphicIter` which does not yet do the `TrivialClone` specialization and is burdened by the iterator and unwind safety shenanigans for all types, so this PR should address some of that. This should in turn slightly reduce both stack usage and remove unwinding prologue/epilogue etc. from such functions and improve our `-Cno-prepopulate-passes` codegen too.

perf: https://godbolt.org/z/eTPjj3hP3
This updates the rust-version file to c58275e0369d09fc3959b8ba87dcbcbe73797465.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 30, 2026

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 May 30, 2026
@tshepang tshepang merged commit ebd7a5b into main May 30, 2026
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label May 30, 2026
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.

9 participants