Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Oct 31, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nnethercote and others added 14 commits October 27, 2025 16:36
Of the many dataflow analyses, `ConstAnalysis` is the only one that requires
the analysis be mutabile when used with `ResultsVisitor`. It's needed
because of the `ecx` field -- `ecx.intern_with_temp_alloc` is called
during visiting and it takes `&mut self`.

This commit changes `ConstAnalysis` to use interior mutability for the
`ecx` field. This is a bit annoying for `ConstAnalysis`, but it will
allow more immutability in `ResultsVisitor`, as seen in the next commit.
This makes sense -- you wouldn't expect that visiting the results of an
analysis would change the analysis itself.
Put `analysis` first, to match `apply_effects_in_range`.
This will let us make `Analysis` arguments in many other places
immutable, in the next commit.
The `state: A::Domain` value is the primary things that's modified when
performing an analysis. The `Analysis` impl is immutable in every case
but one (`MaybeRequiredStorage`) and it now uses interior mutability.

As well as changing many `&mut A` arguments to `&A`, this also:
- lets `CowMut` be replaced with the simpler `SimpleCow` in `cursor.rs`;
- removes the need for the `RefCell` in `Formatter`;
- removes the need for `MaybeBorrowedLocals` to impl `Clone`, because
  it's a unit type and it's now clear that its constructor can be used
  directly instead of being put into a local variable and cloned.
`Results` used to contain an `Analysis`, but it was removed in rust-lang#140234.
That change made sense because the analysis was mutable but the entry
states were immutable and it was good to separate them so the mutability
of the different pieces was clear.

Now that analyses are immutable there is no need for the separation,
lots of analysis+results pairs can be combined, and the names are going
back to what they were before:
- `Results` -> `EntryStates`
- `AnalysisAndResults` -> `Results`
…jgillot

Use `mut` less in dataflow analysis

`&mut Analysis` is used a lot:
- In results visitors, even though only one visitor needs mutability.
- In all the `apply_*` methods, even though only one visitor needs mutability.

I've lost track of the number of times I've thought "why are these `mut` again?" and had to look through the code to remind myself. It's really unexpected, and most `Analysis` instances are immutable, because the `state` values are what get mutated.

This commit introduces `RefCell` in one analysis and one results visitor. This then lets another existing `RefCell` be removed, and a ton of `&mut Analysis` arguments become `&Analysis`. And then `Analysis` and `Results` can be recombined.

r? `@cjgillot`
…dead

Fix deferred cast checks using the wrong body for determining constness

re-introduces rust-lang#103683

it was lost in rust-lang@4fec845

deferred checks possibly have more such issues, needs investigation.

r? `@fee1-dead`
bootstrap: Extract parts of `bootstrap::core::builder` into a `cli_paths` module

One of the things that makes bootstrap's CLI path handling hard to work with is the fact that it's in the middle of a ~2000 line file full of all sorts of other things. And the primary code sequence is in an unhelpfully-named `StepDescription::run` function.

This PR therefore pulls some key chunks of code out into a `cli_paths` submodule.

This should be a purely non-functional change.
@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. rollup A PR which is a rollup labels Oct 31, 2025
@Zalathar
Copy link
Member Author

Rollup of everything.

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Oct 31, 2025

📌 Commit 472c7cd 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 Oct 31, 2025
@bors
Copy link
Collaborator

bors commented Oct 31, 2025

⌛ Testing commit 472c7cd with merge 51f5892...

@bors
Copy link
Collaborator

bors commented Oct 31, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 31, 2025
@bors bors merged commit 51f5892 into rust-lang:master Oct 31, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Oct 31, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#148165 Use mut less in dataflow analysis f77377cd2c5056c99f9d74f360fe5c15dd5689e7 (link)
#148287 Fix deferred cast checks using the wrong body for determini… 5214f01446df93793b2f0788a5d879429b5e95be (link)
#148317 bootstrap: Extract parts of bootstrap::core::builder into… 4c1e91c13743ef0419665fb46f3e468ea6cb675c (link)

previous master: 23c7bad921

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

@github-actions
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 23c7bad (parent) -> 51f5892 (this PR)

Test differences

Show 10 test diffs

Stage 1

  • [ui] tests/ui/traits/const-traits/issue-103677.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/issue-103677.rs#cnst: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/issue-103677.rs#stock: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/traits/const-traits/issue-103677.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/issue-103677.rs#cnst: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/issue-103677.rs#stock: [missing] -> pass (J0)

Additionally, 4 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 51f5892019f8fb07864647d46c4eb577d3b0719f --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-apple-various: 3196.8s -> 4992.3s (+56.2%)
  2. dist-aarch64-linux: 8722.6s -> 6635.8s (-23.9%)
  3. aarch64-apple: 8468.3s -> 6823.9s (-19.4%)
  4. dist-x86_64-apple: 6390.2s -> 7286.5s (+14.0%)
  5. aarch64-msvc-2: 5638.9s -> 4853.3s (-13.9%)
  6. aarch64-gnu-llvm-20-1: 3840.5s -> 3389.3s (-11.8%)
  7. i686-gnu-2: 6299.3s -> 5579.6s (-11.4%)
  8. test-various: 6424.9s -> 7105.6s (+10.6%)
  9. pr-check-1: 1643.1s -> 1474.5s (-10.3%)
  10. i686-msvc-2: 7304.5s -> 8053.5s (+10.3%)
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 (51f5892): comparison URL.

Overall result: ❌✅ regressions and 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.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.3% [-0.3%, -0.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.3%, -0.2%] 2

Max RSS (memory usage)

Results (primary -1.7%, secondary 2.1%)

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

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

Cycles

Results (secondary 3.4%)

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)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (secondary -0.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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 473.971s -> 474.501s (0.11%)
Artifact size: 390.89 MiB -> 390.85 MiB (-0.01%)

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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants