Skip to content

Rollup of 12 pull requests - #162100

Closed
jhpratt wants to merge 38 commits into
rust-lang:mainfrom
jhpratt:rollup-GF7J3Uh
Closed

Rollup of 12 pull requests#162100
jhpratt wants to merge 38 commits into
rust-lang:mainfrom
jhpratt:rollup-GF7J3Uh

Conversation

@jhpratt

@jhpratt jhpratt commented Sep 1, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Zalathar and others added 30 commits August 5, 2026 20:41
The existing name doesn't give a good intuition for what's actually happening,
which is that we lower a (possibly complex) boolean condition and then proceed
if it's true or break if it's false.

This commit also directly exposes the arguments struct to callers, since it
makes the call sites more self-documenting.
This convention is a little less intuitive for simple if-expressions, but is
easier to follow when dealing with complex nested conditions or with other
if-like constructs.
Also contains a formatting change due to rustfmt bump
Rename it `BUILTIN_ATTRIBUTE_SET` because it's a set, and use `contains`
instead of `get` where appropriate.
Also fix a typo and wrap some overlong comment lines.
Fix typos, wrap overlong lines, add missing comments, etc.
Avoid mixing it with `NonZeroU32`.
Every caller passes a predicate that just does a name comparison.
For dist-aarch64-linux (full):

* GHA 8c takes 2h25m ($2.03/build)
* c8g.8xl takes 1h20m ($1.69/build)
* c9g.8xl takes 1h ($1.38/build)
* c9g.4xl takes 1h10m ($0.81/build)
* m9g.2xl takes 1h30m ($0.59/build) - selected

And adds a dist-aarch64-linux-quick:

* c8g.8xl takes 50m ($1.059/build)
* c9g.8xl takes 40m ($0.924/build)
* c9g.4xl takes 47m ($0.543/build) - selected
* m9g.2xl takes 64m ($0.417/build)

For now I've chosen a balance between cost and speed (c9g.4xl). Once we
decide where to enable this (e.g., in try builds by default) we can
consider aligning with other tasks and saving $/build if we're not able
to benefit from increased speed (e.g., because perf won't run until the
try build as a whole finishes).

For dist-x86_64-linux-full we have this breakdown:

* c8a.8xl takes 1h34m ($2.64/build) - current
* c8a.4xl takes 1h45m ($1.51/build) - selected
* m8a.2xl takes 2h10m ($1.05/build)

I'll re-benchmark dist-x86_64-linux-quick in a future PR, for now it
will stay on c8a.8xl. This drops codebuild configuration (but not yet
cleaning up various related pieces that are more tied into our CI) since
it doesn't seem relevant anymore.
…eature, r=Amanieu

support `#[target_feature(enable = ...)]` on `#[naked]` functions

fixes rust-lang#136280

Instructions that are part of a target feature require a special directive on some targets. This PR adds those for the most common targets.

This is very WIP, but I'm hoping to collect some feedback on what is (not) supported and how to report that to users.

r? @ghost

cc @taiki-e @Amanieu
…ap, r=nia-e

stabilize smart pointer map functions

Tracking issue: rust-lang#144419
@rustbot modify labels: +T-libs-api
mir_build: Clearly distinguish or/refutable/irrefutable patterns during match lowering

This PR has two related parts.

- The first commit divides the various fields of InterPat into three different `InterPatKind` variants, which clearly distinguish between or-pattern nodes, refutable pattern nodes, and irrefutable pattern nodes. Such a split was suggested during review of rust-lang#155144, but at the time I wasn't sure if it was the right direction. Now that I've thought more about how to make it work nicely with InterPat node building, I'm more comfortable with the explicit split.

- As a follow-on, the second commit then splits MatchPairTree into two different `MatchPairKind` variants: one for or-pattern nodes, and one for “testable” nodes.

In both cases, dividing the outer struct into multiple kinds makes it easier to understand and uphold field invariants, since previously-optional fields can be made mandatory or absent.

There should be no change to compiler output.

---
- The changes to MatchPairTree can be seen as an alternative to rust-lang#158551. Instead of splitting or-patterns and testable-patterns into separate lists, they still occupy the same list but are distinguished by kind.

---

r? Nadrieril
mir_build: Clarify parts of if-condition lowering

I've been looking at this condition-lowering code a lot, and I noticed that some parts are hard to follow due to how functions and variables are named.

In particular, the function name `then_else_break` doesn't give much useful intuition for the fact that it lowers an `if` condition (or similar), and then proceeds if the condition was true or breaks if the condition was false.

Similarly, I was finding it hard to keep track of the two destinations selected after evaluating a condition, especially when dealing with complex subconditions like `||` or `!`, or looking at different callers. So this PR tries to establish a convention of always using `(true_block, false_block)` to refer to the condition's outcome paths, which can then be manipulated as appropriate by calling code.

There should be no observable change to compiler behaviour.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 1, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations 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-infra Relevant to the infrastructure 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-release Relevant to the release subteam, 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 1, 2026
@jhpratt

jhpratt commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple-,x86_64-mingw-1,i686-msvc-

@rust-bors

rust-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 218fba1 has been approved by jhpratt

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 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 1, 2026
Rollup of 12 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple-*
try-job: x86_64-mingw-1
try-job: i686-msvc-*
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-21-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

25    0: __rustc::rust_begin_unwind
26    1: core::panicking::panic_fmt
27    2: core::panicking::panic
-    3: rust_out::main::_doctest_main__home_imperio_rust_rust_tests_rustdoc_ui_doctest_doc_cfg_target_feature_rs_14_0
+    3: rust_out::main::_doctest_main__checkout_tests_rustdoc_ui_doctest_doc_cfg_target_feature_rs_14_0
29    4: rust_out::main
30    5: <fn() as core::ops::function::FnOnce<()>>::call_once
31 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


The actual stdout differed from the expected stdout
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args doctest/doc-cfg-target-feature.rs`

error: 1 errors occurred comparing output.
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "/checkout/tests/rustdoc-ui/doctest/doc-cfg-target-feature.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/doctest/doc-cfg-target-feature" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Cdebuginfo=0" "--test"
--- stdout -------------------------------

running 1 test
test /checkout/tests/rustdoc-ui/doctest/doc-cfg-target-feature.rs - foo (line 14) ... FAILED

---
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: rust_out::main::_doctest_main__checkout_tests_rustdoc_ui_doctest_doc_cfg_target_feature_rs_14_0
   4: rust_out::main
   5: <fn() as core::ops::function::FnOnce<()>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


---

13 oh no
14 stack backtrace:
15    0: std::panicking::begin_panic::<&str>
-    1: rust_out::main::_doctest_main__home_imperio_rust_rust_tests_rustdoc_ui_doctest_force_target_feature_rs_10_0
+    1: rust_out::main::_doctest_main__checkout_tests_rustdoc_ui_doctest_force_target_feature_rs_10_0
17    2: rust_out::main
18    3: <fn() as core::ops::function::FnOnce<()>>::call_once
19 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


The actual stdout differed from the expected stdout
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args doctest/force-target-feature.rs`

error: 1 errors occurred comparing output.
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "/checkout/tests/rustdoc-ui/doctest/force-target-feature.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/doctest/force-target-feature" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Cdebuginfo=0" "--test" "-C" "target-feature=+avx"
--- stdout -------------------------------

running 1 test
test /checkout/tests/rustdoc-ui/doctest/force-target-feature.rs - SomeStruct (line 10) ... FAILED

---
thread 'main' (348781) panicked at /checkout/tests/rustdoc-ui/doctest/force-target-feature.rs:3:1:
oh no
stack backtrace:
   0: std::panicking::begin_panic::<&str>
   1: rust_out::main::_doctest_main__checkout_tests_rustdoc_ui_doctest_force_target_feature_rs_10_0
   2: rust_out::main
   3: <fn() as core::ops::function::FnOnce<()>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


@jhpratt jhpratt closed this Sep 1, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 1, 2026
@jhpratt
jhpratt deleted the rollup-GF7J3Uh branch September 1, 2026 03:16
@rust-bors

rust-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR #162014, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

@rust-bors

rust-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 273328f failed: CI. Failed jobs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-infra Relevant to the infrastructure 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-release Relevant to the release subteam, 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.