Skip to content

Rollup of 9 pull requests - #162503

Merged
rust-bors[bot] merged 41 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Gh517p9
Sep 9, 2026
Merged

Rollup of 9 pull requests#162503
rust-bors[bot] merged 41 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Gh517p9

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

valentynkit and others added 30 commits July 30, 2026 16:39
Drop the unused name parameter from `Thread::new_current`, abort if the
OS id is set twice, and stop promising uniqueness of os_id in the docs.
diff --git a/library/std/src/thread/thread.rs b/library/std/src/thread/thread.rs
index ff6affa..d70c244 100644
--- a/library/std/src/thread/thread.rs
+++ b/library/std/src/thread/thread.rs
@@ -125,7 +125,8 @@ pub(crate) fn new_current(id: ThreadId) -> Thread {
         thread
     }

-    /// Records the OS id of the calling thread in this handle.
+    /// Records the calling thread's OS id, as reported by
+    /// `imp::current_os_id`, in this handle.
     ///
     /// May only be called from the thread to which this handle belongs. A
     /// spawned thread does this itself once it starts running, since its handle
@@ -240,12 +241,17 @@ pub fn id(&self) -> ThreadId {
     ///
     /// This is the id that shows up in tools like `ps` and `top`, debuggers and
     /// crash logs, unlike [`ThreadId`], which has no guaranteed relationship to
-    /// it. `None` means the platform has no such id, the thread has not started
-    /// running yet, or the id could not be read.
+    /// it. On a platform with no OS-visible thread id, such as SGX, the value
+    /// may be some other per-thread value (there, the thread's address), which
+    /// such tools will not recognize. `None` means no id could be recorded: the
+    /// thread has not started running yet, or the platform has no way to read
+    /// one.
     ///
     /// The operating system may reuse the id of a thread that has exited, and a
-    /// `Thread` handle can outlive the thread it refers to. Use the id only
-    /// where a reused id is harmless, such as logging.
+    /// `Thread` handle can outlive the thread it refers to. After a `fork`, the
+    /// id recorded in the child process still refers to the parent's thread; it
+    /// is not re-read. Use the id only where a reused or stale id is harmless,
+    /// such as logging.
     ///
     /// # Examples
     ///
`Assumptions::new` now elaborates the clauses it is given, so callers
which build assumptions straight from where clauses no longer each have
to remember to do it themselves. A `Ty: 'a` clause also tells us that
every region component of `Ty` outlives `'a`, and that the components
themselves do, which placeholder and alias outlives need.

It takes clauses rather than only the outlives ones because trait
clauses imply outlives through their supertraits: `T: Bound<'a>` with
`trait Bound<'c>: 'static` is evidence for `T: 'static`. Narrowing the
input to outlives clauses would drop those before elaboration could
reach them.

The test harness keeps using `new_unelaborated` so that a `forall`'s
assumptions are exactly the ones written down in the test, with no
extra ones hidden behind the scenes.
`known_type_outlives` only holds the explicit `Ty: 'a` where clauses.
The implied bounds, e.g. `T: 'a` from a `&'a T` argument, are tracked
separately in `region_bound_pairs`, so both have to be passed in.
Without them we fail to prove `T: 'a` for a `&'a T` argument whenever
the only explicit bound on `T` mentions a different region.
`FreeRegionMap::relation` stores `'sub <= 'sup` edges while
`Assumptions::region_outlives` expects `'longer: 'shorter` ones. The
mismatch is not yet observable as nothing reads the region relation at
the root, but `Assumptions::new` merges edges derived from type
outlives clauses into the same relation, which would otherwise leave it
with mixed edge directions.
…es, r=nikomatsakis

Support move expressions in coroutine closures

This adds `move(expr)` support for coroutine closures.

- [x] Support for move expressions in coroutine closures
- [x] Support for move expressions in async blocks

RFC: rust-lang/rfcs#3968
Tracking issue: rust-lang#155050
Project goal:
- rust-lang/goals#107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

I used AI to write the tests and reviewed them myself.

r? @nikomatsakis
Implement `Thread::os_id`

Implements `Thread::os_id` as an unstable feature, per the accepted ACP rust-lang/libs-team#635.

Tracking issue: rust-lang#160215

`os_id` returns the OS-level thread id, so Rust programs can tie their own logs to system-level logs (the ACP's stated motivation).

- Using the existing `current_os_id` is much simpler than pulling the id off `imp::Thread` in `spawn_unchecked`. That needs a per-platform arm, and the child still has to fill it in on platforms without a by handle query, so it'd be extra on top of this rather than instead of it.
- `Thread` is handed to user code by spawn hooks before the native thread exists, so the id can only be filled in later. There's no spare `u64` value to mean "not set yet", so a OnceLock is chosen as a simple primitive to use for this purpose.

r? libs
…e-redundant-shared-reference, r=mati865

Prefer removing a redundant shared reference over reborrow

Fixes rust-lang#133685
…=petrochenkov

Ignore `self-in-const-generics` test for parallel frontend

This is the guidance for failing tests in the parallel frontend per [#t-infra/announcements > rustc parallel frontend CI job @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/533458-t-infra.2Fannouncements/topic/rustc.20parallel.20frontend.20CI.20job/near/612990835)
To work around rust-lang#162316
…d, r=Kobzol

Reserve items in `Extend` implementations

This might be a perf win, inspired by @Kobzol's approach in this PR: rust-lang#162480
…utlives_assumptions, r=BoxyUwU

trait solver: Include implied outlives assumptions

Part of rust-lang/project-assumptions-on-binders#19

Split out of rust-lang#161988 after @BoxyUwU pointed out that these are about which assumptions we keep, not really about reflexive region constraints.

I went back through where each piece comes from and found two gaps. Inside a binder we kept `Ty: 'a`, but the region relation only knew about explicit region clauses. That means something like `&'b T: 'a` did not also give us `'b: 'a`. At the root it was a slightly different version of the same problem: `known_type_outlives` has the explicit where clauses, while implied bounds from things like `&'b self` live in `region_bound_pairs`, so constraint destructuring never saw them.

`Assumptions::new` now pulls the free region components out of type outlives clauses and adds those edges to the region relation. I think doing it there is the cleanest spot. All callers get the same view of an assumption, and the original type clauses stay around for placeholder and alias cases. Regions bound inside the type are ignored because they do not name anything we can use outside that binder.

The root path now adds its implied type bounds to the same assumption set before destructuring. The regression uses an implied `I: 'b` from a receiver and a separate `'b: 'a` relation, so it covers this without leaning on the reflexive fix from rust-lang#161988. There are also binder checks for a reference and a higher-ranked function type. Those caught an easy testing trap here: a green direct constraint could have depended on the other PR, so the checks look at the lifted candidates instead.

Personally, I think splitting this was the right call. It is really a change to how assumption data is built, and that is easier to reason about on its own than under the reflexive constraint fix.

cc @BoxyUwU, this is the pair of changes you asked me to pull out.
Small `x perf` improvements

Tiny improvements I found while using this command locally.

r? JonathanBrouwer
…ys, r=JonathanBrouwer

Clean up on upvar_tys

Found some duplicated code when digging rust-lang#162440

r? @lcnr
…aumeGomez

Move the `expect-item-after-attribute.rs` test to the correct directory

To address the comment here: rust-lang#162386 (comment)

r? @GuillaumeGomez
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 8, 2026
@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. T-libs Relevant to the library team, 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 8, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 52152ad 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 8, 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 9, 2026
@rust-bors

rust-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 18m 5s
Pushing 0d31508 to main...

@rust-bors
rust-bors Bot merged commit 0d31508 into rust-lang:main Sep 9, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

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 4aa1fbc (parent) -> 0d31508 (this PR)

Test differences

Show 147 test diffs

Stage 1

  • [ui (polonius)] tests/ui/assumptions_on_binders/supertrait-implied-outlives-assumptions.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/assumptions_on_binders/type-outlives-assumptions.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/move-expr/async-blocks.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/move-expr/async-gen-blocks.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/move-expr/gen-blocks.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/move-expr/gen-closures.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/move-expr/nested-async-block-ownership.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/move-expr/nested-move-exhausted.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/suggestions/redundant-shared-reference-issue-133685.rs: [missing] -> pass (J0)
  • [ui] tests/ui/assumptions_on_binders/supertrait-implied-outlives-assumptions.rs: [missing] -> pass (J3)
  • [ui] tests/ui/assumptions_on_binders/type-outlives-assumptions.rs: [missing] -> pass (J3)
  • [ui] tests/ui/move-expr/async-blocks.rs: [missing] -> pass (J3)
  • [ui] tests/ui/move-expr/async-gen-blocks.rs: [missing] -> pass (J3)
  • [ui] tests/ui/move-expr/gen-blocks.rs: [missing] -> pass (J3)
  • [ui] tests/ui/move-expr/gen-closures.rs: [missing] -> pass (J3)
  • [ui] tests/ui/move-expr/nested-async-block-ownership.rs: [missing] -> pass (J3)
  • [ui] tests/ui/move-expr/nested-move-exhausted.rs: [missing] -> pass (J3)
  • [ui] tests/ui/suggestions/redundant-shared-reference-issue-133685.rs: [missing] -> pass (J3)
  • thread::tests::test_thread_os_id_matches_current: [missing] -> pass (J6)
  • thread::tests::test_thread_os_id_of_spawned_thread: [missing] -> pass (J6)
  • [ui] tests/rustdoc-ui/doctest/expect-item-after-attribute.rs: [missing] -> pass (J8)
  • [ui] tests/rustdoc-ui/expect-item-after-attribute.rs: pass -> [missing] (J8)

Stage 2

  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J1)
  • [ui] tests/ui/assumptions_on_binders/supertrait-implied-outlives-assumptions.rs: [missing] -> pass (J2)
  • [ui] tests/ui/assumptions_on_binders/type-outlives-assumptions.rs: [missing] -> pass (J2)
  • [ui] tests/ui/move-expr/async-blocks.rs: [missing] -> pass (J2)
  • [ui] tests/ui/move-expr/async-gen-blocks.rs: [missing] -> pass (J2)
  • [ui] tests/ui/move-expr/gen-blocks.rs: [missing] -> pass (J2)
  • [ui] tests/ui/move-expr/gen-closures.rs: [missing] -> pass (J2)
  • [ui] tests/ui/move-expr/nested-async-block-ownership.rs: [missing] -> pass (J2)
  • [ui] tests/ui/move-expr/nested-move-exhausted.rs: [missing] -> pass (J2)
  • [ui] tests/ui/suggestions/redundant-shared-reference-issue-133685.rs: [missing] -> pass (J2)
  • thread::tests::test_thread_os_id_matches_current: [missing] -> pass (J4)
  • thread::tests::test_thread_os_id_of_spawned_thread: [missing] -> pass (J4)
  • [ui] tests/rustdoc-ui/doctest/expect-item-after-attribute.rs: [missing] -> pass (J5)
  • [ui] tests/rustdoc-ui/expect-item-after-attribute.rs: pass -> [missing] (J5)
  • [ui] tests/ui/traits/alias/self-in-const-generics.rs: pass -> ignore (ignored when the parallel frontend is enabled) (J7)

Additionally, 110 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 0d31508599a7814a7044e9a7a871e3dc5f037753 --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. test-aarch64-apple-macos-26-2: 1h 41m -> 2h 32m (+50.1%)
  2. dist-powerpc64-linux-musl: 1h 6m -> 1h 39m (+49.8%)
  3. test-x86_64-gnu-parallel-frontend: 1h 26m -> 2h 4m (+43.6%)
  4. test-arm-android: 2h 6m -> 1h 18m (-38.0%)
  5. dist-armv7-linux: 1h 11m -> 1h 37m (+36.2%)
  6. test-pr-check-1: 51m 22s -> 32m 55s (-35.9%)
  7. test-i686-gnu-2: 1h 13m -> 1h 38m (+34.6%)
  8. test-x86_64-msvc-2: 2h 35m -> 1h 43m (-33.4%)
  9. test-aarch64-apple-1: 1h 39m -> 2h 9m (+29.9%)
  10. test-x86_64-gnu-stable: 2h 51m -> 2h 1m (-29.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 (0d31508): 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 (primary 0.5%, secondary 1.6%)

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

mean range count
Regressions ❌
(primary)
0.9% [0.4%, 2.1%] 12
Regressions ❌
(secondary)
3.1% [2.2%, 4.7%] 6
Improvements ✅
(primary)
-1.2% [-2.6%, -0.4%] 3
Improvements ✅
(secondary)
-3.0% [-3.5%, -2.5%] 2
All ❌✅ (primary) 0.5% [-2.6%, 2.1%] 15

Cycles

Results (primary -0.3%, 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.8% [0.5%, 1.5%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-2.7%, -0.5%] 11
Improvements ✅
(secondary)
-3.4% [-4.8%, -2.0%] 2
All ❌✅ (primary) -0.3% [-2.7%, 1.5%] 19

Binary size

Results (primary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.1%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 7

Bootstrap: 483.174s -> 480.949s (-0.46%)
Artifact size: 403.30 MiB -> 403.34 MiB (0.01%)

@rust-bors

rust-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#157738 Support move expressions in coroutine closures 46e49f51b2dd5b0600dcdee47623ee82893f3848
(link)
#160219 Implement Thread::os_id 4152a02484c74a621aaf222ffbbe2670a914604d
(link)
#162449 Prefer removing a redundant shared reference over reborrow 5aedd32f08b2efb324eab62c43502e8ca926717d
(link)
#162494 Ignore self-in-const-generics test for parallel frontend ab2fba56a0499f520c7a39c906decd8174db9da5
(link)
#162495 Reserve items in Extend implementations a2e42af9935a10b563e6380a1c482c262243d611
(link)
#162238 trait solver: Include implied outlives assumptions 6c373790a9694ad074d905d93d27af7423c61ca5
(link)
#162473 Small x perf improvements 04276c7cf682f36f0dc1fc13ca6ddaca17c297d6
(link)
#162489 Clean up on upvar_tys c144f5095cc54d2454eafdd8f59aeb0da05bfb88
(link)
#162500 Move the expect-item-after-attribute.rs test to the corre… b1eebc2eabcb6e9218b491825fbb7fe401ea4952
(link)

parent commit: 4aa1fbcf46

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

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. T-libs Relevant to the library team, 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.

8 participants