Skip to content

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Sep 1, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

petrochenkov and others added 21 commits August 29, 2025 17:23
Signed-off-by: Connor Tsui <[email protected]>
Signed-off-by: Connor Tsui <[email protected]>
Co-authored-by: Jonas Böttiger <[email protected]>
```
error[E0277]: the trait bound `usize: Neg` is not satisfied
  --> $DIR/negative-literal-infered-to-unsigned.rs:2:14
   |
LL |     for x in -5..5 {
   |              ^^ the trait `Neg` is not implemented for `usize`
   |
help: consider specifying an integer type that can be negative
   |
LL |     for x in -5isize..5 {
   |                +++++
```
It has a single call site.
The code is more readable without it.
The dynamic dispatch cost doesn't matter for MIR dumping, which is
perf-insensitive. And it's necessary for the next commit, which will
store some `extra_data` closures in a struct.
This commit exists purely to simplify reviewing: these functions will
become methods in the next commit. This commit indents them so that the
next commit is more readable.
MIR dumping is a mess. There are lots of functions and entry points,
e.g. `dump_mir`, `dump_mir_with_options`, `dump_polonius_mir`,
`dump_mir_to_writer`. Also, it's crucial that `create_dump_file` is
never called without `dump_enabled` first being checked, but there is no
mechanism for ensuring this and it's hard to tell if it is satisfied on
all paths. (`dump_enabled` is checked twice on some paths, however!)

This commit introduces `MirWriter`, which controls the MIR writing, and
encapsulates the `extra_data` closure and `options`. Two existing
functions are now methods of this type. It sets reasonable defaults,
allowing the removal of many `|_, _| Ok(())` closures.

The commit also introduces `MirDumper`, which is layered on top of
`MirWriter`, and which manages the creation of the dump files,
encapsulating pass names, disambiguators, etc. Four existing functions
are now methods of this type.
- `MirDumper::new` will only succeed if dumps are enabled, and will
  return `None` otherwise, which makes it impossible to dump when you
  shouldn't.
- It also sets reasonable defaults for various things like
  disambiguators, which means you no longer need to specify them in many
  cases. When they do need to be specified, it's now done via setter
  methods.
- It avoids some repetition. E.g. `dump_nll_mir` previously specifed the
  pass name `"nll"` four times and the disambiguator `&0` three times;
  now it specifies them just once, to put them in the `MirDumper`.
- For Polonius, the `extra_data` closure can now be specified earlier,
  which avoids having to pass some arguments through some functions.
…avidtwco

`dump_mir` cleanups

I found this code hard to read, so I cleaned it up. Details in individual commits.

r? ``@davidtwco``
Add `Bound::copied`

Tracking Issue: rust-lang#145966

Some questions:

- [x] Should I update the documentation for `cloned` to actual used a `Clone` type instead of an integer?
- [x] I removed the `must_use` since this is a cheap copy, does that make sense?
resolve: Refactor `struct ExternPreludeEntry`

Avoid impossible combinations of fields and apply the first part of rust-lang#144737 (do not resolve erroneous entries repeatedly, keep them as `PendingBinding::Ready(None)` instead).
Detect negative literal inferred to unsigned integer

```
error[E0277]: the trait bound `usize: Neg` is not satisfied
  --> $DIR/negative-literal-infered-to-unsigned.rs:2:14
   |
LL |     for x in -5..5 {
   |              ^^ the trait `Neg` is not implemented for `usize`
   |
help: consider specifying an integer type that can be negative
   |
LL |     for x in -5isize..5 {
   |                +++++
```

Applying this suggestion will always end up in another E0308 error at the point where the unsigned inference comes from, which should help with understanding what the actual problem is.

Fix rust-lang#83413.
…s-for-ret-ty-error, r=estebank

Suggest method name with maybe ty mismatch

Fixes rust-lang#146008

I think it's ok to suggest method name even when the return ty mismatch, since we only reporting in `Applicability::MaybeIncorrect`, user may add `()` and continue to fix following errors.

r? ```@estebank```
…r=RalfJung

Change std f32 test to pass under Miri

Adds `APPROX_DELTA` to 2 tests of `f32::log` reported in [#miri > Miri test-libstd Failure (2025-08)](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282025-08.29).

I changed 2 lines, the first one is the actual failure. The second one is precautionary.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. rollup A PR which is a rollup labels Sep 1, 2025
@Zalathar
Copy link
Contributor Author

Zalathar commented Sep 1, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Sep 1, 2025

📌 Commit 0dbd8e6 has been approved by Zalathar

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 Sep 1, 2025
@bors
Copy link
Collaborator

bors commented Sep 1, 2025

⌛ Testing commit 0dbd8e6 with merge be4e9b7...

@bors
Copy link
Collaborator

bors commented Sep 1, 2025

☀️ Test successful - checks-actions
Approved by: Zalathar
Pushing be4e9b7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 1, 2025
@bors bors merged commit be4e9b7 into rust-lang:master Sep 1, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 1, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#145421 dump_mir cleanups df2690bad2bfff55a2854659a05500f4e165079d (link)
#145968 Add Bound::copied c41c2409295592240e20a09e5ab990efb06d68bd (link)
#146004 resolve: Refactor struct ExternPreludeEntry 83ccfb9511f57342c5dc39fd56929c1a052f2d42 (link)
#146042 Detect negative literal inferred to unsigned integer 3cb912cfbd6264e225e75979180001e21262d6b5 (link)
#146046 Suggest method name with maybe ty mismatch 1400ec28ec2e43e26d3576b177b8508605f2d246 (link)
#146051 Change std f32 test to pass under Miri 7ad339f8a473b3d73671bb92e3808bf65fb0b121 (link)

previous master: 828e45ad11

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

Copy link
Contributor

github-actions bot commented Sep 1, 2025

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 828e45a (parent) -> be4e9b7 (this PR)

Test differences

Show 94 test diffs

Stage 1

  • [ui] tests/ui/suggestions/negative-literal-infered-to-unsigned.rs: [missing] -> pass (J0)
  • [ui] tests/ui/typeck/suggest-method-name-with-maybe-ty-mismatch-146008.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/suggestions/negative-literal-infered-to-unsigned.rs: [missing] -> pass (J1)
  • [ui] tests/ui/typeck/suggest-method-name-with-maybe-ty-mismatch-146008.rs: [missing] -> pass (J1)

Additionally, 90 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 be4e9b77ab5502b7beda0b787fb3c978a7b4db79 --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. dist-aarch64-apple: 6628.7s -> 5433.8s (-18.0%)
  2. dist-aarch64-msvc: 6554.7s -> 5606.3s (-14.5%)
  3. dist-x86_64-apple: 7192.9s -> 6258.3s (-13.0%)
  4. dist-apple-various: 3557.3s -> 3149.5s (-11.5%)
  5. i686-gnu-2: 6157.3s -> 5730.7s (-6.9%)
  6. x86_64-gnu-llvm-19-2: 6036.8s -> 5656.6s (-6.3%)
  7. x86_64-msvc-2: 6684.6s -> 7038.0s (5.3%)
  8. aarch64-gnu-debug: 4695.0s -> 4938.6s (5.2%)
  9. dist-powerpc64-linux: 5190.4s -> 5454.5s (5.1%)
  10. dist-x86_64-solaris: 5190.4s -> 5452.2s (5.0%)
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

Finished benchmarking commit (be4e9b7): 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.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.2% [-0.2%, -0.1%] 3
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 8
All ❌✅ (primary) -0.2% [-0.2%, -0.1%] 3

Max RSS (memory usage)

Results (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)
2.2% [2.1%, 2.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.8% [-2.2%, -1.4%] 2
All ❌✅ (primary) - - 0

Cycles

Results (secondary 6.0%)

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)
8.2% [2.3%, 15.9%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 466.581s -> 468.792s (0.47%)
Artifact size: 388.59 MiB -> 388.52 MiB (-0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants