Skip to content

Rollup of 18 pull requests - #161338

Merged
rust-bors[bot] merged 59 commits into
rust-lang:mainfrom
jhpratt:rollup-gDOZoei
Aug 19, 2026
Merged

Rollup of 18 pull requests#161338
rust-bors[bot] merged 59 commits into
rust-lang:mainfrom
jhpratt:rollup-gDOZoei

Conversation

@jhpratt

@jhpratt jhpratt commented Aug 19, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Embers-of-the-Fire and others added 30 commits May 21, 2026 15:14
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
Add focused Miri coverage for the if-let closure capture change, demonstrating UB at closure construction when partial pattern capture reborrows dangling references.

Assisted-by: OpenAI:gpt-5.5
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
… orphan check

`emit_orphan_check_error` already special-cases non-local types that
appear in a foreign trait's own parameter position (as opposed to
Self): for Slice, Array, and Tuple, the label reads "this is
not defined in the current crate because this is a foreign trait"
instead of naming the type. The Adt arm and the primitive/catch-all
arm never checked this and always named the type instead, even in the
same non-Self position.

This produced a confusing diagnostic for impls like

    impl PartialEq for u32 {}

where Rhs defaults to Self (u32), so both the Self label and
the Rhs label read `u32` is not defined in the current crate,
with the second one visually landing under PartialEq since the
defaulted Rhs has no span of its own.

Extend the existing is_foreign check to the Adt and catch-all arms
so all four cases behave consistently.

Addresses rust-lang#160648
This was already possible via `./x fix -- --allow-dirty`, but forwarding the
argument from bootstrap is more user-friendly.
This commit is an initial implementation of the `FnPtr` trait as
described in the `fn_static` tracking issue, which consists of moving
the internally unstable `core::marker::FnPtr` to `core::ops::FnPtr`, as
well as changing the API. Because `NonNull` is used in the new `as_ptr`
signature, it was also turned into a proper lang item.
Rust only supports the windowed Xtensa calling convention on all
upstream targets (esp32 family). Mark windowed and exception as
ABI-required features so a mismatched -Ctarget-cpu cannot silently
change the ABI.

Discussion: rust-lang#160530 (comment)
Rust currently supports a single Xtensa ABI, so apply the same spec
checks as wasm: unspecified llvm_abiname, no floatabi, no rustc_abi,
and unspecified or other cfg_abi.
under the next solver a closure whose signature doesnt match emitted two errors at the same span. the trait goal `C: FnMut(&i32)` failed, and the `<C as FnOnce<..>>::Output == bool` projection goal resting on it failed out of that same unification. the old solver collapses both into a single `type mismatch in closure arguments`, so the projection error was noise.

suppress a projection error when another error at the same span is a trait goal it rests on. ambiguity errors are exempt, they get merged into one diagnostic whose notes list every constraint the annotation has to satisfy, so their projections still say something the trait error doesnt.
elaborating `cond` reaches supertraits, so a projection resting on a supertrait got suppressed even when that supertrait holds and the projection had failed for its own reasons. that dropped a real error, on the old solver too.

require the trait goal the projection rests on to be unproven before treating the trait error as covering it.
@rustbot rustbot added O-windows Operating system: Windows 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-clippy Relevant to the Clippy team. 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. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 19, 2026
@jhpratt

jhpratt commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2f3f287 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 Aug 19, 2026
@rust-bors

This comment has been minimized.

@rust-highfive

Copy link
Copy Markdown
Contributor

📣 Toolstate changed by #161338!

Tested on commit 9ba81c2.
Direct link to PR: #161338

🎉 nomicon on windows: test-fail → test-pass (cc @JohnTitor @traviscross).
🎉 nomicon on linux: test-fail → test-pass (cc @JohnTitor @traviscross).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Aug 19, 2026
Tested on commit rust-lang/rust@9ba81c2.
Direct link to PR: <rust-lang/rust#161338>

🎉 nomicon on windows: test-fail → test-pass (cc @JohnTitor @traviscross).
🎉 nomicon on linux: test-fail → test-pass (cc @JohnTitor @traviscross).
@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 Aug 19, 2026
@rust-bors

rust-bors Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 7m 54s
Pushing 9ba81c2 to main...

@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 19aa2d7 (parent) -> 9ba81c2 (this PR)

Test differences

Show 1529 test diffs

Stage 1

  • [ui (polonius)] tests/ui/closures/2229_closure_analysis/if-let-patterns-capture-analysis.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/closures/2229_closure_analysis/run_pass/if-let-capture.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/coherence/coherence-orphan-foreign-adt-diagnostic.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/feature-gates/feature-gate-fn_static.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/fn/fn-ptr-trait-run.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/parallel-rustc/fn-sig-cycle-ice-154056.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/parallel-rustc/fn-sig-cycle-ice-154560.rs: pass -> [missing] (J1)
  • [ui (polonius)] tests/ui/traits/next-solver/diagnostics/dont-suppress-independent-projection-error.rs#current: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/traits/next-solver/diagnostics/dont-suppress-independent-projection-error.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/closures/2229_closure_analysis/if-let-patterns-capture-analysis.rs: [missing] -> pass (J2)
  • [ui] tests/ui/closures/2229_closure_analysis/run_pass/if-let-capture.rs: [missing] -> pass (J2)
  • [ui] tests/ui/coherence/coherence-orphan-foreign-adt-diagnostic.rs: [missing] -> pass (J2)
  • [ui] tests/ui/feature-gates/feature-gate-fn_static.rs: [missing] -> pass (J2)
  • [ui] tests/ui/fn/fn-ptr-trait-run.rs: [missing] -> pass (J2)
  • [ui] tests/ui/parallel-rustc/fn-sig-cycle-ice-154056.rs: [missing] -> pass (J2)
  • [ui] tests/ui/parallel-rustc/fn-sig-cycle-ice-154560.rs: pass -> [missing] (J2)
  • [ui] tests/ui/traits/next-solver/diagnostics/dont-suppress-independent-projection-error.rs#current: [missing] -> pass (J2)
  • [ui] tests/ui/traits/next-solver/diagnostics/dont-suppress-independent-projection-error.rs#next: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/closures/2229_closure_analysis/if-let-patterns-capture-analysis.rs: [missing] -> pass (J0)
  • [ui] tests/ui/closures/2229_closure_analysis/run_pass/if-let-capture.rs: [missing] -> pass (J0)
  • [ui] tests/ui/coherence/coherence-orphan-foreign-adt-diagnostic.rs: [missing] -> pass (J0)
  • [ui] tests/ui/feature-gates/feature-gate-fn_static.rs: [missing] -> pass (J0)
  • [ui] tests/ui/fn/fn-ptr-trait-run.rs: [missing] -> pass (J0)
  • [ui] tests/ui/parallel-rustc/fn-sig-cycle-ice-154056.rs: [missing] -> pass (J0)
  • [ui] tests/ui/parallel-rustc/fn-sig-cycle-ice-154560.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/next-solver/diagnostics/dont-suppress-independent-projection-error.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/traits/next-solver/diagnostics/dont-suppress-independent-projection-error.rs#next: [missing] -> pass (J0)

Additionally, 1502 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 9ba81c26fe1be0c8730083a1b6da070bc7c51726 --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. x86_64-gnu-stdlib-semver-check: 11m 38s -> 19m 55s (+71.2%)
  2. x86_64-rust-for-linux: 35m 37s -> 59m 19s (+66.5%)
  3. x86_64-gnu-llvm-22-2: 1h -> 1h 36m (+57.7%)
  4. dist-arm-linux-musl: 1h 12m -> 1h 47m (+47.5%)
  5. i686-gnu-nopt-2: 1h 38m -> 2h 24m (+46.6%)
  6. x86_64-gnu-gcc-core-tests: 12m 20s -> 17m 58s (+45.7%)
  7. i686-msvc-1: 2h 10m -> 3h 6m (+42.7%)
  8. dist-x86_64-solaris: 1h 45m -> 1h 4m (-39.2%)
  9. x86_64-msvc-ext2: 1h 24m -> 1h 56m (+37.9%)
  10. dist-s390x-linux: 1h 7m -> 1h 32m (+37.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 (9ba81c2): 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.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.3%, 0.2%] 2

Max RSS (memory usage)

Results (primary 3.7%)

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

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

Cycles

Results (primary -2.3%)

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.3% [-2.8%, -1.6%] 8
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.3% [-2.8%, -1.6%] 8

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

Bootstrap: 456.445s -> 455.183s (-0.28%)
Artifact size: 398.98 MiB -> 398.99 MiB (0.00%)

@rust-bors

rust-bors Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#154210 fix: fix the capture behavior of if let in closures 943b03c1eaab275a1e456015e1a966257720fc4b
(link)
#156176 Initial implementation of FnPtr trait aaa2f61a8ece875d7e01c2e98fdaf1a9187a1707
(link)
#160767 Unify E0117 foreign-trait label for ADT/primitive types wit… 5cc790d76106bde88eb4a6bcb830c4ba15618cbb
(link)
#161297 std: use UNIX's Instant and SystemTime on Hermit ea06018bbcc9d90b1f4f790e03acd00355281c58
(link)
#160489 Adding diagnostic item markers for multiple fs functions an… 9dd8f4be264579d77332b106fb563c35f91a63bd
(link)
#160643 Require windowed (and exception) for Xtensa ABI 0642223c632f462bad7336ab10b25e9c1d5be6d8
(link)
#161088 suppress projection errors already covered by a trait error 57e29e97beef3e9014a6451d8f317bb11c269f32
(link)
#161114 Remove fields from TypeKind: Struct, Enum, Union and Tuple fad62ee6c2748ceb86d547ede55af10a72fcfdef
(link)
#161115 Assorted allocator nitpicks c234b87c69317762904621803e9afbb8d1412a09
(link)
#161220 bootstrap: Allow ./x fix --allow-dirty d3c642b2c09112a6738b3b188120431acfffdab0
(link)
#161296 Enable overflow checks in rustc_thread_pool ef6babea3e14ebc64f5b2652e5be51200e726981
(link)
#161298 remove rustc_error_messages dependency 60be3f73b2c13308b605b682cc8bf3ac007f1ae8
(link)
#161304 Rename test so it matches the issue 7be15f50c5c65ba17625736564388126fd0361a9
(link)
#161309 allow(non_camel_case_types) in minicore.rs 2c8d5503a3d38fe4a21cdc0dcb91ad0bbf28f7b8
(link)
#161315 Relax codgen test variable regex 13c7f7dbfff10bf0fa37ca5179de35161920d2bb
(link)
#161318 Doc: clarify how Read::bytes handling Interrupted errors e4e49433192ca2b0581514397ced9a856a7fc476
(link)
#161321 Update books 712e62592bf6740e21a56f59766be3a208a437a8
(link)
#161335 [compiletest] Use the correct rustc lib directory for query… bda733430aee244c910edab252c2cfb1e0b58403
(link)

parent commit: 19aa2d70ec

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

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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. T-rust-analyzer Relevant to the rust-analyzer 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.