Skip to content

Rollup of 2 pull requests - #163017

Merged
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-F4gB7uA
Sep 19, 2026
Merged

rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-F4gB7uA

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Zalathar and others added 6 commits September 19, 2026 12:23
This makes it easier to confirm that the move itself doesn't modify any code.
Having non-trivial code in the crate root causes a few problems, most
of which stem from every item being effectively `pub(crate)`:

- Fields/methods can't be private, so enforcing abstractions is impossible
- Every `use` becomes a de-facto re-export, leading to messy imports
- Moving items out of the root requires visibility adjustment
cg_llvm: Move all code out of the crate root

Having non-trivial code in the crate root causes a few problems, most of which stem from every item being effectively `pub(crate)`:

- Fields/methods can't be private, so enforcing abstractions is impossible
- Every `use` becomes a de-facto re-export, leading to messy imports
- Moving items out of the root requires visibility adjustment

This PR therefore moves all non-trivial code out of the crate root, and into `rustc_codegen_llvm::back::llvm_backend`.

---

Deciding where to move the code *to* was a bit tricky. But the code being moved delegates a lot of its methods to other submodules in `back`, so creating another submodule in `back` seemed reasonable. I certainly like it more than the status-quo.

The main commit doesn't modify any of the code being moved, other than updating imports, as verified manually by:

```shell
git diff --color-moved --color-moved-ws=allow-indentation-change head^ head
```

There should be no change to compiler behaviour.
…-doc, r=Darksonn

Add safety section for transmute_neo

Refer to [`transmute`](crate::mem::transmute) for safety requirements. This function is semantically identical to `transmute`.

According to my investigation, the transmute uses typeck to guarantee the size equality of from and to, while the transmute_neo uses const { assert! } to guarantee it. And in codegen, the unreachable fallback covers transmute_unchecked (also for transmute and transmute_neo, but it is the only guarantee for transmute_unchecked). So transmute_neo's safety doc referring to transmute poses no problem and risk.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 19, 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-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. labels Sep 19, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit db1f6e1 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 Sep 19, 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 Sep 19, 2026
@rust-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 8m 36s
Pushing feaadee to main...

@rust-bors
rust-bors Bot merged commit feaadee into rust-lang:main Sep 19, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 19, 2026
@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 36b04f3 (parent) -> feaadee (this PR)

Test differences

Show 40 test diffs

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

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard feaadeeaca7db0594da854e7c8c07495341c7439 --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-x86_64-msvc-alt: 1h 42m -> 3h 3m (+80.1%)
  2. dist-i686-linux: 1h 7m -> 1h 54m (+70.2%)
  3. dist-x86_64-musl: 1h 28m -> 2h 22m (+60.3%)
  4. test-x86_64-gnu-llvm-21-2: 1h 4m -> 1h 40m (+55.5%)
  5. dist-riscv64-linux-gnu: 1h 1m -> 1h 32m (+50.1%)
  6. test-x86_64-gnu-miri: 1h 25m -> 45m 13s (-47.3%)
  7. test-x86_64-rust-for-linux: 57m 22s -> 33m 2s (-42.4%)
  8. test-x86_64-gnu-llvm-22-2: 1h 41m -> 59m 55s (-41.2%)
  9. test-x86_64-gnu-gcc: 1h 18m -> 48m 2s (-39.1%)
  10. dist-loongarch64-linux: 2h 7m -> 1h 24m (-34.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-bors

rust-bors Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#163003 cg_llvm: Move all code out of the crate root 37e4d1801082a3e6cf7e83b807abdbaf653b37cf
(link)
#163008 Add safety section for transmute_neo 3b766a518a02c3ce64ea8216a759cc2527956395
(link)

parent commit: 36b04f3ad1

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
Copy Markdown

Finished benchmarking commit (feaadee): comparison URL.

Overall result: ❌ regressions - 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.5% [0.4%, 0.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.5%)

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

Cycles

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

Binary size

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

Bootstrap: 497.193s -> 502.551s (1.08%)
Artifact size: 408.84 MiB -> 406.86 MiB (-0.48%)

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

4 participants