Skip to content

Rollup of 4 pull requests#155599

Merged
rust-bors[bot] merged 14 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-cI1hRiI
Apr 21, 2026
Merged

Rollup of 4 pull requests#155599
rust-bors[bot] merged 14 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-cI1hRiI

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

CoCo-Japan-pan and others added 14 commits March 5, 2026 20:07
In cg_gcc ModuleBuffer already only contains a path anyway. And for
moving LTO into -Zlink-only we will need to serialize MaybeLtoModules.
By storing a path cached modules we avoid writing them to the disk a
second time during serialization of MaybeLtoModules.
Another interal change that shouldn't impact rustc users.
The goal (of this commit and a few afterwards) is to break apart the gigantic
visit_type function into more managable and easily-editable bits that focus
on specific parts of FFI safety.
For now, we break the code specific to enums one side, and
structs/unions on the other, into separate visit_? methods
Another interal change that shouldn't impact rustc users.
the list of simpler type-based decisions made by `visit_type` are
reordered and are given better documentation.
Another interal change that shouldn't impact rustc users.
This time, regroup into `visit_indirections` the code dealing with the
FFI safety of Boxes, Refs and RawPtrs.
Another interal change that shouldn't impact rustc users.
Code called outside of `visit_type` (and callees) is moved inside, by
adding new types to properly track the state of a type visitation.
- OuterTyKind tracks the knowledge of the type "directly outside of" the
  one being visited (if we are visiting a struct's field, an array's
  element, etc)
- RootUseFlags tracks the knowledge of how the "original type being
  visited" is used: static variable, function argument/return, etc.
Modify error message of importing inherent associated items when `#[feature(import_trait_associated_functions)]` is enabled

Fixes rust-lang#148009

This PR improves the diagnostic for importing inherent associated items from a struct or union when
`#[feature(import_trait_associated_functions)]` (rust-lang#134691) is enabled.

Previously, this would result in a "not a module" error. This change provides a more specific error message clarifying that only trait associated items can be imported, while inherent associated items remain ineligible for import.

Enums are currently excluded from this change because their variants are valid import targets and require distinct handling.
….2, r=petrochenkov

Improperctypes refactor2.2

This is "part 2/3 of 2/3 of 1/2" of the original pull request rust-lang#134697 (refactor plus overhaul of the ImproperCTypes family of lints)
(all pulls of this series of pulls are supersets of the previous pulls.)
previous pull: rust-lang#155358
next pull: rust-lang#146273

This commit splits the lint's `visit_type` function into multiple functions that focus on specific things:
- visit_indirection (references, boxes, raw pointers)
- visit_variant_fields (the list of fields of a struct, enum variant, or union)
- visit_enum
- visit_struct_or_union
- visit_type (most "easy" decisions such as labeling `char` unsafe are here)

since, during these visits, we often move from an "outer type" to an "inner type" (structs, arrays, pointers, etc...),
two structs have been added to track the current state of a visit:
- VisitorState tracks the state related to the "original type" being checked (function argument/return, static variable)
- OuterTyData tracks the data related to the type "immediately outer to the current visited type"

r? petrochenkov (because you asked me to)
Store a PathBuf rather than SerializedModule for cached modules

In cg_gcc `ModuleBuffer` already only contains a path anyway. And for moving LTO into `-Zlink-only` we will need to serialize `MaybeLtoModules`. By storing a path cached modules we avoid writing them to the disk a second time during serialization of `MaybeLtoModules`.

Some further improvements will require changes to cg_gcc that I would prefer landing in the cg_gcc repo to actually test the LTO changes in CI.

Part of rust-lang/compiler-team#908
add warning message when using x fix

Fix for issue: rust-lang#155545

Before:
<img width="1880" height="329" alt="image" src="https://github.com/user-attachments/assets/b713d940-f229-4c63-8df8-93634f017793" />

After:
<img width="1897" height="387" alt="image" src="https://github.com/user-attachments/assets/5bbca701-b319-45ca-9d46-39847c50b6f8" />

Text added

```
WARNING: `x fix` is provided on a best-effort basis and does not support all `cargo fix` options correctly.
```
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Apr 21, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. labels Apr 21, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

📌 Commit e150483 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 Apr 21, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 21, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 15m 6s
Pushing d2f88d4 to main...

@rust-bors rust-bors Bot merged commit d2f88d4 into rust-lang:main Apr 21, 2026
12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 21, 2026
@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#152611 Modify error message of importing inherent associated items… d4a1cf41902c296eaf465e313c4d72ee7b7df7f3 (link)
#155036 Store a PathBuf rather than SerializedModule for cached mod… 88bdec5ebf7737a1d67e7563eedc81867c2f9eee (link)
#155359 Improperctypes refactor2.2 433a64e19304fa76e0772724162033eaaab0e6a5 (link)
#155554 add warning message when using x fix 7497b4ff0c94f437579bf4c5cd61d83dffca66b6 (link)

previous master: 365515367b

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
Copy Markdown
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 3655153 (parent) -> d2f88d4 (this PR)

Test differences

Show 7 test diffs

Stage 1

  • [ui] tests/ui/imports/import-inherent-148009.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/imports/import-inherent-148009.rs: [missing] -> pass (J0)

Additionally, 5 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 d2f88d4b65f64f61293b739bc0c7f97b3a7805a8 --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: 1h 37m -> 2h 7m (+31.1%)
  2. dist-powerpc64le-linux-gnu: 1h 17m -> 1h 37m (+26.0%)
  3. i686-msvc-1: 2h 25m -> 3h 2m (+25.4%)
  4. x86_64-msvc-1: 2h 40m -> 1h 59m (-25.2%)
  5. x86_64-gnu-distcheck: 2h 19m -> 1h 46m (-23.4%)
  6. dist-powerpc-linux: 1h 12m -> 1h 28m (+23.0%)
  7. dist-x86_64-msvc-alt: 2h 39m -> 2h 5m (-21.0%)
  8. pr-check-1: 33m 35s -> 27m 3s (-19.5%)
  9. dist-sparcv9-solaris: 1h 15m -> 1h 30m (+19.3%)
  10. dist-x86_64-freebsd: 1h 16m -> 1h 28m (+16.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
Copy Markdown
Collaborator

Finished benchmarking commit (d2f88d4): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary 3.6%)

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

Cycles

Results (primary 2.0%)

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

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

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: 490.033s -> 494.08s (0.83%)
Artifact size: 394.42 MiB -> 394.39 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. merged-by-bors This PR was explicitly merged by bors. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants