Skip to content

Rollup of 9 pull requests - #166671

Closed
JonathanBrouwer wants to merge 23 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-JFCO2M0
Closed

JonathanBrouwer wants to merge 23 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-JFCO2M0

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

maxdexh and others added 23 commits September 30, 2026 20:25
## Stabilization report

### What is stabilized

With trim-paths `object` scope and debuginfo on,
Cargo writes `<artifact>.trim-paths.json` beside each final artifact.
The "unremap" file maps the remapped paths back to local ones.

This stabilizes debugger script changes:
`rust-gdb` and `rust-lldb` by default load `{gdb,lldb}_trim_paths.py`,
which read the unremap files and apply them
through GDB `substitute-path` or LLDB `target.source-map`
to set up source file path substitutions.

### What changes

* After stabilization, set `RUST_{GDB,LLDB}_TRIM_PATHS=0` to opt out.
  Before, this needed `RUST_{GDB,LLDB}_TRIM_PATHS=unstable`.
* After stabilization, both scripts are shipped on all channels.
  Before, they were shipped only on nightly.

### Why we don't want to stabilize

* This makes debugger scripts relying on Cargo-specific file format,
  inversing the dependency relation.
* There is no integration test for them.
  (and debugger scripts actually don't have many tests)

### Docs

See Cargo's the "Unremap files" section:
<https://github.com/rust-lang/cargo/blob/ac74ae3c603b9efce95b07383b46d3103e834d9a/doc/book/src/reference/profiles.md?plain=1#L337-L386>
I guess things got renamed and there were some editing mishaps.
…ustdoc, r=GuillaumeGomez

Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope

# Stabilization report of  `--remap-path-scope` in rustdoc and the `documentation` scope

## 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` to control which generted output has remapped paths in `rustdoc`.

Cargo is starting to use the `rustc` flag with rust-lang/cargo#17488.

Tracking issue: rust-lang#155451.

It's the last major part of the trim-paths feature.

### What is stabilized

The rustdoc `--remap-path-scope` flag is being stabilized by this PR. It's equivalent to [the rustc flag](https://doc.rust-lang.org/rustc/remap-source-paths.html#--remap-path-scope).

It permits defines which scopes should be remapped by `-–remap-path-prefix`: `macro,diagnostics,documentation,debuginfo,coverage,object,all`.

#### Example

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

#### The `documentation`

In addition to the [other scopes](https://doc.rust-lang.org/rustc/remap-source-paths.html#--remap-path-scope) (`diagnostics`, `debuginfo`, ...). `rustdoc` uses the `documentation` scope, it's a new scope to be shared with `rustc` (T-compiler [FCP here](rust-lang#163896)).

## Implementation

### Major parts

- rust-lang#155357
- rust-lang#151589
- rust-lang#163956
- rust-lang#164278
- rust-lang#164279

### Coverage

- [`tests/rustdoc-ui/remap-path-prefix.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/rustdoc-ui/remap-path-prefix.rs)
- [`tests/rustdoc-ui/remap-path-prefix-doctest.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/rustdoc-ui/remap-path-prefix-doctest.rs)
- [`tests/ui/errors/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/ui/errors/remap-path-prefix-macro.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

There are no outstanding bugs regarding `--remap-path-scope` 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-scope` (in rustc or rustdoc).

Fixes rust-lang#163896
Fixes rust-lang#155451
…, r=Urgau

debugger: stabilize trim-paths unremap file loading

## Stabilization report

### What is stabilized

With trim-paths `object` scope and debuginfo on, Cargo writes `<artifact>.trim-paths.json`[^1] beside each final artifact. This "unremap" file, maps the remapped paths back to local ones. The file format and remapping rules are stabilized as part of FCP on Cargo side: rust-lang/cargo#17488

This stabilizes debugger script changes: `rust-gdb` and `rust-lldb` by default load `{gdb,lldb}_trim_paths.py`, which read the unremap files and apply them through GDB `substitute-path` or LLDB `target.source-map` to set up source file path substitutions.

Note that we already apply an unremap for `/rustc/$RUSTC_COMMIT_HASH` paths, so it wouldn't be a new capability per se, just an extension of it.

### What changes

* After stabilization, set `RUST_{GDB,LLDB}_TRIM_PATHS=0` to opt out.
  Before, it required `RUST_{GDB,LLDB}_TRIM_PATHS=unstable` to enable.
* After stabilization, both scripts are shipped on all channels.
  Before, they were shipped only on nightly.

### Why we don't want to stabilize

* This makes debugger scripts relying on Cargo-specific file format, inversing the dependency relation.
* There is no integration test for them.
  (and debugger scripts actually don't have many tests)

### Docs

See Cargo's the "Unremap files" section: <https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#unremap-files>.

> The unremap file is in JSON format:
>
> * `v` carries the format version.
> * `rust_version` and `workspace_root` are file-level metadata, namely the toolchain version and the workspace root.
> * `remaps` is an array of records. Each record maps a sanitized path prefix in the artifact (`from`) back to the local path it replaced (`to`), ordered by the `from` prefix. Note that this follows the debugger substitution direction, which is the inverse of `--remap-path-prefix`.
>
> An example of the unremap file:
>
> ```json
> {
>   "v": 1,
>   "rust_version": "1.96.0-nightly",
>   "workspace_root": "/home/me/app",
>   "remaps": [
>     { "from": ".", "to": "/home/me/app" },
>     { "from": "/cargo/build-dir", "to": "/home/me/app/target" },
>     { "from": "/cargo/registry/6f17d22d3f0a95d1", "to": "/home/me/.cargo/registry/src/index.crates.io-6f17d22d3f0a95d1" },
>     { "from": "/rustc/abc123", "to": "/home/me/.rustup/toolchains/nightly/lib/rustlib/src/rust" }
>   ]
> }
> ```
>
> Since it is meant to be a debugging aid, it includes absolute paths of your system, so there is no artifact privacy guarantee. You might want to exclude `*.trim-paths.json` files when distributing artifacts.

---

Should be shipped after <rust-lang#163881> (or along with that)
…nthey

Use `__fastfail()` for `crash()` on Windows

[`__fastfail`](https://learn.microsoft.com/en-us/cpp/intrinsics/fastfail?view=msvc-180) is the preferred way to quickly abort the process on this platform. Unlike `ud2`, it won't go through SEH.

See previously rust-lang#149780

@rustbot label O-windows
…3898-clean, r=petrochenkov

fix: ignore format literal source availability in stable hashes

fixes [rust-lang#153898](rust-lang#153898).

installing rust-src could change a crate's strict version hash (SVH) due to source-dependent format-string desugaring.
this change excludes the diagnostic-only FormatLiteral.source field from stable hashing while preserving diagnostic behavior.

adds a regression test covering unimplemented!, todo!, unreachable!, and generic functions.
verifies metadata with and without rust-src using identical compiler flags.

r? compiler
…eetrees

add c-variadic support for `x87_f80`

tracking issue: rust-lang#163982

The default paths already have the right behavior. Validated with abi-cafe.
…t, r=folkertdev

Don't round the number of bits passed to `{Size,Align}::from_bits`

The current behaviour is more likely to mask typos than be the intended behaviour, and can give the misleading impression that `Size` can store sizes that are a non-whole-number of bytes. This is particularly nonsensical for `Align::from_bits` where `Align::from_bits(24)` has always been an error whereas `Align::from_bits(25)` was rounded up to a 32-bit alignment before this PR. The only places where the current rounding behaviour is relied upon are a few places where `Size::from_bits(1)` is used as a constant to represent the size of a `bool` (1 byte) - this PR replaces those with the more explicit `Size::from_bytes(1)`/`Size::from_bits(8)`. If the rounding behaviour is needed in the future, a dedicated `Size::ceil_from_bits` method can be added.

r? @folkertdev
…-dir-override, r=Kobzol

fix: bootstrap build directory handling with --set

fixes rust-lang#166607
handle `--set build.build-dir` in python bootstrap using the existing toml parser, so both bootstrap implementations use the same directory.
added unit tests and verified the original repro.
cc @Kobzol
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 27, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-process Area: `std::process` (note: `std::env` is A-env) A-rc Area: `Rc` and `Arc` A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool O-windows Operating system: Windows labels Nov 27, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 27, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 94ac463 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - #163910 (debugger: stabilize trim-paths unremap file loading)
 - #166175 (Use `__fastfail()` for `crash()` on Windows)
 - #166377 (fix: ignore format literal source availability in stable hashes)
 - #166510 (add c-variadic support for `x87_f80`)
 - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - #166641 (fix: bootstrap build directory handling with --set)
 - #166655 (Submodule update of rustc-perf)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error: none of the predicates in this `cfg_select` evaluated to true
  --> library/core/src/os/windows.rs:58:9
   |
58 | /         cfg_select! {
59 | |             // Miri does not support inline assembly
60 | |             miri => crate::intrinsics::abort_immediate(),
61 | |             any(target_arch = "x86", target_arch = "x86_64") => {
...  |
70 | |         }
   | |_________^

error: aborting due to 1 previous error

error: doctest failed, to rerun pass `-p core --doc`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2024 --crate-type lib --color always --crate-name core --test library/core/src/lib.rs --test-run-directory /checkout/library/core --target wasm32-wasip3 --test-runtool /wasmtime-v48.0.2-x86_64-linux/wasmtime --test-runtool-arg run --test-runtool-arg -C --test-runtool-arg cache=n --test-runtool-arg --dir --test-runtool-arg . --test-runtool-arg --wasi --test-runtool-arg inherit-env,inherit-network,allow-ip-name-lookup -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-wasip3/dist/build/compiler_builtins/0afe1f966aa50217/out --test-args -Z --test-args unstable-options --test-args --format --test-args json --warn=unexpected_cfgs --check-cfg 'cfg(no_fp_fmt_parse)' --check-cfg 'cfg(feature, values(any()))' --check-cfg 'cfg(target_has_reliable_f16)' --check-cfg 'cfg(target_has_reliable_f16_math)' --check-cfg 'cfg(target_has_reliable_f16b)' --check-cfg 'cfg(target_has_reliable_f128)' --check-cfg 'cfg(target_has_reliable_f128_math)' --check-cfg 'cfg(no_io_statics)' --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-wasip3/dist/build/core/d37fda4a6e0fa22b/out/libcore-d37fda4a6e0fa22b.rlib --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-wasip3/dist/build/core/d37fda4a6e0fa22b/out/libcore-d37fda4a6e0fa22b.rmeta -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/dist/build/core/2965637426736e34/out -C embed-bitcode=no --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("debug_refcell", "optimize_for_size", "panic_immediate_abort"))' -Zannotate-moves '--check-cfg=cfg(feature,values(any()))' -Zunstable-options '-Wrustdoc::invalid_codeblock_attributes' --crate-version '1.102.0-nightly (cca35f549 2026-11-27)' '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' '-Zcrate-attr=warn(rust_2018_idioms)' -Znext-solver=coherence --error-format human` (exit status: 1)
note: test exited abnormally; to see the full output pass --no-capture to the harness.
Bootstrap failed while executing `--stage 2 test --host= --target wasm32-wasip3 tests/run-make tests/run-make-cargo tests/ui tests/mir-opt tests/codegen-units tests/codegen-llvm tests/assembly-llvm library/core library/alloc`
Currently active steps:
test::Crate { build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: wasm32-wasip3, mode: Std, crates: ["core", "alloc"] } at src/bootstrap/src/core/build_steps/test.rs:3653
Build completed unsuccessfully in 0:51:32
  local time: Fri Nov 27 19:06:49 UTC 2026

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 27, 2026
@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

💔 Test for cca35f5 failed: CI. Failed job:

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 27, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 27, 2026
@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

PR #166175, which is a member of this rollup, was unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-process Area: `std::process` (note: `std::env` is A-env) A-rc Area: `Rc` and `Arc` A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool O-windows Operating system: Windows rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants