Skip to content

Rollup of 12 pull requests #144028

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 40 commits into from
Jul 16, 2025
Merged

Rollup of 12 pull requests #144028

merged 40 commits into from
Jul 16, 2025

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Jul 16, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

hkBst and others added 30 commits July 3, 2025 09:05
If the remote process is terminated by a signal, make `remote-test-client` exit
with the code `128 + <signal-number>` instead of always `3`. This follows common
practice among tools such as bash [^1]:

> When a command terminates on a fatal signal whose number is N, Bash uses the
> value 128+N as the exit status.

It also allows us to differentiate between `run-pass` and `run-crash` ui tests
without special case code in compiletest for that when `remote-test-client` is
used.

[^1]: https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
Implements https://www.github.com/rust-lang/rust/issues/141358.

This has 2 primary benefits:

1. For rustdoc-json consumers, they no longer need to parse strings of
   attributes, but it's there in a structured and normalized way.
2. For rustc contributors, the output of HIR pretty printing is no
   longer a versioned thing in the output. People can work on
   rust-lang#131229 without needing to
   bump `FORMAT_VERSION`.

(Over time, as the attribute refractor continues, I expect we'll add new
things to `rustdoc_json_types::Attribute`. But this can be done
separately to the rustc changes).
…istime, r=GuillaumeGomez

rustdoc-json: Structured attributes

Implements and closes rust-lang#141358.

This has 2 primary benefits.

1. For rustdoc-json consumers, they no longer need to parse strings of attributes, but it's there in a structured and normalized way. CC ```@obi1kenobi```
2. For rustc conributors, the output of HIR pretty printing is no longer a versioned thing in the output. People can work on rust-lang#131229 without needing to bump `FORMAT_VERSION`. CC ```@jdonszelmann``` ```@JonathanBrouwer.```

(Over time, as the attribute refractor continues, I expect we'll add new things to `rustdoc_json_types::Attribute`. But this can be done separately to the rustc changes).

Todo before being mergable:
- [x] Update test assertions.
- [x] Fix modeling of `#[repr]`.
- [ ] ~~Add tests of `#[doc(hidden)]` in `Item::attrs` (probably in a seperate PR).~~ I'm gonna punt this to a future PR
- [x] Documentation.
…, r=Mark-Simulacrum

wrapping shift: remove first bitmask and table

```rust
        #[inline(always)]
        pub const fn wrapping_shl(self, rhs: u32) -> Self {
            // SAFETY: the masking by the bitsize of the type ensures that we do not shift
            // out of bounds
            unsafe {
                self.unchecked_shl(rhs & (Self::BITS - 1))
            }
        }
```
already does the bitmask, so it seems unnecessary here.

More context: internals.rust-lang.org/t/wrapping-shift-operator-code-doing-bitmasking-twice/23167
…bzol

tidy: check for invalid file names

Check for file names added to git with:
- non-UTF8 filenames (this would fail "fmt check" with a decoding error for the moment, but maybe we should not count on it as it is an accidental failure)
- control characters (such as "\n" or "\r" in file names)
- ":" (which is a special character on Windows, made rust-lang#142936 fail in bors while it could have be caught earlier)

It only checks files known by git as a developer might want to have "strange" file names alongside their local repository as long as they don't check them in.

r? jieyouxu
as he stumbled upon such a file in rust-lang#142936
Add tracing to `InterpCx::fn_abi_of_instance/fn_abi_of_fn_ptr`

This PR adds tracing to the `InterpCx::fn_abi_of_instance`/`::fn_abi_of_fn_ptr` functions by shadowing `FnAbiOf`'s trait methods with inherent methods on `InterpCx`, like done in rust-lang#142721. The reason why I am targeting these two functions is because they are used for Miri interpretation, and they make a `layout_of` query down the line without passing through the `layout_of` that was traced in rust-lang#142721.

There are other places where `layout_of` is called without being traced (see the analysis below), but that's because the `Machine` used there is not `MiriMachine` but rather `CompileTimeMachine` which does not implement `enter_trace_span()`. But after discussing with ```````@RalfJung``````` we agreed that the const-eval part should not be traced together with Miri, that's why I am ignoring the other places where `layout_of` is called.

r? ```````@RalfJung```````

<details><summary>Analysis of the places where <code>layout_of</code> is called</summary>

I did some analysis for rust-lang#142721 (comment), and these are all the places where the query `tcx.layout_of` is called (directly or indirectly) outside of a traced `InterpCx::layout_of` while a program is being interpreted by Miri:

```
adjust_for_rust_scalar  at ./compiler/rustc_ty_utils/src/abi.rs:302:35
{closure#2}             at ./compiler/rustc_ty_utils/src/abi.rs:522:25
eval_body_using_ecx<>   at ./compiler/rustc_const_eval/src/const_eval/eval_queries.rs:49:22
{closure#1}<>           at ./compiler/rustc_const_eval/src/interpret/operand.rs:851:76
{closure#0}<>           at ./compiler/rustc_const_eval/src/interpret/stack.rs:612:18
size_and_align          at ./compiler/rustc_middle/src/mir/interpret/mod.rs:387:38
```

I got these by:
- patching rustc with this patch that adds a span to the `layout_of` query which prints the backtrace:
[layout_of_other_places.diff.txt](https://github.com/user-attachments/files/21235523/layout_of_other_places.diff.txt)
- adding this to my bootstrap.toml to have debug symbols inside the Miri binary: `rust.debuginfo-level = "line-tables-only"` and also `build.tool.miri.features = ["tracing"]`
- obtaining a trace file with `MIRI_TRACING=1 ./x.py run miri --stage 1 --warnings warn --args src/tools/miri/tests/pass/hello.rs` (note: maybe using a file different than "src/tools/miri/tests/pass/hello.rs" would lead to more places where layout_of is called?)
-  running this query in Perfetto to select all `layout_of` spans that have as a direct parent a span named "frame" (as opposed to the parent being `InterpCx::layout_of`) and extract their backtrace: `select args.string_value from slice left join args on slice.arg_set_id = args.id where slice.name = "tcx.layout_of" and slice.parent_id in (select slice2.id from slice as slice2 where slice2.name = "frame") group by args.string_value`
- exporting the data as `.tsv` and processing that file through this Python script. It finds the first path in the backtraces where "layout" isn't mentioned, which imo is a good heuristic to not consider `layout_of` wrappers/friends as call places, but rather go down the backtrace until an actual call place is reached. [layout_of_other_places.py.txt](https://github.com/user-attachments/files/21235529/layout_of_other_places.py.txt)

</details>
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool F-autodiff `#![feature(autodiff)]` 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Jul 16, 2025
@samueltardieu
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

📌 Commit 96a9df4 has been approved by samueltardieu

It is now in the queue for this repository.

@bors bors 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 Jul 16, 2025
@bors
Copy link
Collaborator

bors commented Jul 16, 2025

⌛ Testing commit 96a9df4 with merge 5795086...

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

☀️ Test successful - checks-actions
Approved by: samueltardieu
Pushing 5795086 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 16, 2025
@bors bors merged commit 5795086 into rust-lang:master Jul 16, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 16, 2025
@samueltardieu samueltardieu deleted the rollup-x6f9h8n branch July 16, 2025 18:23
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 1c6de21 (parent) -> 5795086 (this PR)

Test differences

Show 753 test diffs

Stage 1

  • floats::classify::const_::test_f128: [missing] -> pass (J0)
  • floats::classify::const_::test_f16: [missing] -> pass (J0)
  • floats::classify::const_::test_f64: [missing] -> pass (J0)
  • floats::classify::test_f128: [missing] -> pass (J0)
  • floats::classify::test_f32: [missing] -> pass (J0)
  • floats::classify::test_f64: [missing] -> pass (J0)
  • floats::f32::test_classify: pass -> [missing] (J0)
  • floats::f32::test_is_finite: pass -> [missing] (J0)
  • floats::f32::test_is_nan: pass -> [missing] (J0)
  • floats::f32::test_neg_infinity: pass -> [missing] (J0)
  • floats::f32::test_neg_zero: pass -> [missing] (J0)
  • floats::f32::test_num_f32: pass -> [missing] (J0)
  • floats::f32::test_one: pass -> [missing] (J0)
  • floats::f32::test_zero: pass -> [missing] (J0)
  • floats::f64::test_classify: pass -> [missing] (J0)
  • floats::f64::test_infinity: pass -> [missing] (J0)
  • floats::f64::test_is_finite: pass -> [missing] (J0)
  • floats::f64::test_is_infinite: pass -> [missing] (J0)
  • floats::f64::test_is_nan: pass -> [missing] (J0)
  • floats::f64::test_is_normal: pass -> [missing] (J0)
  • floats::f64::test_neg_infinity: pass -> [missing] (J0)
  • floats::f64::test_neg_zero: pass -> [missing] (J0)
  • floats::f64::test_num_f64: pass -> [missing] (J0)
  • floats::infinity::const_::test_f128: [missing] -> pass (J0)
  • floats::infinity::const_::test_f16: [missing] -> pass (J0)
  • floats::infinity::const_::test_f32: [missing] -> pass (J0)
  • floats::infinity::const_::test_f64: [missing] -> pass (J0)
  • floats::infinity::test_f32: [missing] -> pass (J0)
  • floats::is_finite::const_::test_f32: [missing] -> pass (J0)
  • floats::is_finite::test_f32: [missing] -> pass (J0)
  • floats::is_infinite::const_::test_f16: [missing] -> pass (J0)
  • floats::is_infinite::const_::test_f32: [missing] -> pass (J0)
  • floats::is_infinite::const_::test_f64: [missing] -> pass (J0)
  • floats::is_infinite::test_f64: [missing] -> pass (J0)
  • floats::is_nan::const_::test_f16: [missing] -> pass (J0)
  • floats::is_nan::const_::test_f32: [missing] -> pass (J0)
  • floats::is_nan::const_::test_f64: [missing] -> pass (J0)
  • floats::is_normal::const_::test_f128: [missing] -> pass (J0)
  • floats::is_normal::const_::test_f16: [missing] -> pass (J0)
  • floats::is_normal::const_::test_f32: [missing] -> pass (J0)
  • floats::is_normal::test_f32: [missing] -> pass (J0)
  • floats::is_normal::test_f64: [missing] -> pass (J0)
  • floats::neg_infinity::const_::test_f128: [missing] -> pass (J0)
  • floats::neg_infinity::const_::test_f16: [missing] -> pass (J0)
  • floats::neg_infinity::const_::test_f32: [missing] -> pass (J0)
  • floats::neg_infinity::const_::test_f64: [missing] -> pass (J0)
  • floats::neg_infinity::test_f64: [missing] -> pass (J0)
  • floats::neg_zero::const_::test_f128: [missing] -> pass (J0)
  • floats::neg_zero::const_::test_f16: [missing] -> pass (J0)
  • floats::neg_zero::const_::test_f32: [missing] -> pass (J0)
  • floats::neg_zero::const_::test_f64: [missing] -> pass (J0)
  • floats::neg_zero::test_f64: [missing] -> pass (J0)
  • floats::num::const_::test_f128: [missing] -> pass (J0)
  • floats::num::const_::test_f32: [missing] -> pass (J0)
  • floats::num::test_f32: [missing] -> pass (J0)
  • floats::num::test_f64: [missing] -> pass (J0)
  • floats::num_rem::const_::test_f16: [missing] -> pass (J0)
  • floats::num_rem::const_::test_f32: [missing] -> pass (J0)
  • floats::one::const_::test_f128: [missing] -> pass (J0)
  • floats::one::const_::test_f16: [missing] -> pass (J0)
  • floats::one::const_::test_f32: [missing] -> pass (J0)
  • floats::one::const_::test_f64: [missing] -> pass (J0)
  • floats::one::test_f64: [missing] -> pass (J0)
  • floats::zero::const_::test_f128: [missing] -> pass (J0)
  • floats::zero::const_::test_f16: [missing] -> pass (J0)
  • floats::zero::const_::test_f32: [missing] -> pass (J0)
  • floats::zero::test_f64: [missing] -> pass (J0)
  • floats::classify::test_f16: [missing] -> pass (J1)
  • floats::f16::test_classify: pass -> [missing] (J1)
  • floats::f16::test_infinity: pass -> [missing] (J1)
  • floats::f16::test_is_finite: pass -> [missing] (J1)
  • floats::f16::test_is_infinite: pass -> [missing] (J1)
  • floats::f16::test_is_nan: pass -> [missing] (J1)
  • floats::f16::test_is_normal: pass -> [missing] (J1)
  • floats::f16::test_neg_infinity: pass -> [missing] (J1)
  • floats::infinity::test_f16: [missing] -> pass (J1)
  • floats::is_finite::test_f16: [missing] -> pass (J1)
  • floats::is_infinite::test_f16: [missing] -> pass (J1)
  • floats::is_nan::test_f16: [missing] -> pass (J1)
  • floats::is_normal::test_f16: [missing] -> pass (J1)
  • floats::neg_infinity::test_f16: [missing] -> pass (J1)
  • floats::neg_zero::test_f16: [missing] -> pass (J1)
  • floats::num_rem::test_f16: [missing] -> pass (J1)
  • floats::f128::test_classify: pass -> [missing] (J2)
  • floats::f128::test_infinity: pass -> [missing] (J2)
  • floats::f128::test_is_finite: pass -> [missing] (J2)
  • floats::f128::test_is_infinite: pass -> [missing] (J2)
  • floats::f128::test_is_nan: pass -> [missing] (J2)
  • floats::f128::test_is_normal: pass -> [missing] (J2)
  • floats::f128::test_neg_infinity: pass -> [missing] (J2)
  • floats::f128::test_neg_zero: pass -> [missing] (J2)
  • floats::f128::test_num_f128: pass -> [missing] (J2)
  • floats::f128::test_one: pass -> [missing] (J2)
  • floats::f128::test_zero: pass -> [missing] (J2)
  • floats::infinity::test_f128: [missing] -> pass (J2)
  • floats::is_nan::test_f128: [missing] -> pass (J2)
  • floats::num::test_f128: [missing] -> pass (J2)
  • floats::zero::test_f128: [missing] -> pass (J2)
  • [rustdoc-json] tests/rustdoc-json/attrs/repr_c_int_enum.rs: [missing] -> pass (J3)

Stage 2

  • [rustdoc-json] tests/rustdoc-json/attrs/repr_c_int_enum.rs: [missing] -> pass (J4)

(and 42 additional test diffs)

Additionally, 611 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 5795086bdfe7ed988aa53a110bd0692c33d8755b --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 5462.3s -> 3463.2s (-36.6%)
  2. aarch64-apple: 5971.3s -> 3830.4s (-35.9%)
  3. dist-apple-various: 6331.2s -> 7727.8s (22.1%)
  4. pr-check-2: 2792.9s -> 2255.9s (-19.2%)
  5. dist-aarch64-apple: 6011.9s -> 7085.0s (17.8%)
  6. pr-check-1: 1858.9s -> 1527.9s (-17.8%)
  7. x86_64-apple-1: 8178.9s -> 7005.9s (-14.3%)
  8. i686-gnu-2: 6081.5s -> 5471.4s (-10.0%)
  9. x86_64-rust-for-linux: 2965.1s -> 2680.6s (-9.6%)
  10. x86_64-gnu-llvm-20-1: 3646.3s -> 3300.8s (-9.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#142936 rustdoc-json: Structured attributes fdd7a8d93c2c67332f0d92387c64e7f2be695658 (link)
#143355 wrapping shift: remove first bitmask and table ad4481a924427747dcf091c21d89d77ec5e9e61e (link)
#143448 remote-test-client: Exit code 128 + <signal-number> inste… fc77977a952934d72eae6faf9733ac242593eb9a (link)
#143692 miri: fix out-of-bounds error for ptrs with negative offsets 31839874b0f0ec1d514cbeee95914edeaf07d7d4 (link)
#143738 Move several float tests to floats/mod.rs 350edce8f01662820087823761d040d05e430ba6 (link)
#143920 Make more of codegen_llvm safe 09bbc4fc69abafa9d1e9d2f03329d046628123d5 (link)
#143921 Constify Index traits 0a5173204681f0eb4268930d261afa3cd003cb42 (link)
#143939 Add 0323pin as maintainer of NetBSD targets, fix link to pk… c5fb4208dc643a9751ad0a71ee72f2062a967a39 (link)
#143948 Update mdbook to 0.4.52 a2578c4eefe013b77a2807949b07b5d9d261805e (link)
#143957 tidy: check for invalid file names d9d43c70ee3b091c9c97f80ecef34167519bf3d1 (link)
#143968 Add tracing to `InterpCx::fn_abi_of_instance/fn_abi_of_fn_p… 2bcc9367169d53f70df16ae6ac4c534d49763562 (link)
#143990 Add LocalKey::update 66e0954007a3fc284d09e0743a22b348a8bdbfb4 (link)

previous master: 1c6de21509

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5795086): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 13
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.0%, secondary -0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [1.5%, 2.1%] 2
Improvements ✅
(primary)
-2.0% [-2.1%, -2.0%] 2
Improvements ✅
(secondary)
-4.2% [-4.2%, -4.2%] 1
All ❌✅ (primary) -2.0% [-2.1%, -2.0%] 2

Cycles

Results (primary 3.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 464.891s -> 466.738s (0.40%)
Artifact size: 374.78 MiB -> 374.76 MiB (-0.01%)

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-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool F-autodiff `#![feature(autodiff)]` merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.