Skip to content

Rollup of 6 pull requests - #163386

Merged
rust-bors[bot] merged 14 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-VqKqcjW
Sep 26, 2026
Merged

rust-bors[bot] merged 14 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-VqKqcjW

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

sourcefrog and others added 14 commits May 25, 2026 11:22
Link to warning that platform-specific behavior is subject to change
with or without a const initializer, on all platforms.
It was testing diagnostics emitted for missing lifetime specifiers in `thread_local!`,
but now elided lifetimes in `thread_local!` are `'static`, so there's nothing to test.
Signed-off-by: tison <wander4096@gmail.com>
…fonthey

Document platform-specific behavior of `current_exe`, including that Linux can add `" (deleted)"`

This documents one other OS-specific behavior that might be surprising to some users. The underlying behavior is documented in for example <https://man7.org/linux/man-pages/man5/proc_pid_exe.5.html>.

Rust std docs can't and shouldn't try to cover every single OS quirk but this seems reasonably in line with telling people how to use this function, and with the text above about what happens when the exe has been renamed.

This came up in the context of zed-industries/zed#46367

Fixes rust-lang#69343 (by documenting the behavior)
Allow elided ('static) lifetimes in `thread_local!`

with or without a const initializer, on all platforms.

Lifetime elision on functions includes named lifetimes and `'static` in input lifetime positions, so if we give the macro-generated `__rust_std_internal_init_fn` function an argument mentioning `'static`, then elided lifetimes in the return type default to `'static`. This uses `PhantomData<&'static ()>` so that it should probably compile down to nothing (at least in release mode).

Before this change, elided `'static` lifetimes were allowed only with `const` initializers on the "no-threads" and "native" `thread_local!` implementations, not on the "os" implementation, and not with non-`const` initializers.

After this change, they are allowed in all `thread_local!` implementations, with or without a `const` initializer (`A` and `B` both compile on targets with all three `thread_local!` implementations.)

```rs
// Const initializer
std::thread_local!(static A: &str = const { "" });
// Non-const initializer
std::thread_local!(static B: &str = "");
```

|  `thread_local!` implementation | `const` initializer (`A`) | non-`const` initializer (`B`) |
| ------------- | ------------- | ---- |
| no-threads (e.g. `x86_64-unknown-uefi`)   | ✅️ | ❌️ -> ✅️ |
| `target_thread_local` (e.g. `x86_64-unknown-linux-gnu`) | ✅️ | ❌️ -> ✅️ |
| os (e.g. `x86_64-pc-windows-gnu`) | ❌️ -> ✅️ | ❌️ -> ✅️ |

An alternative implementation that would only fix the inconsistency between targets, but not add support for elision with non-`const` initializers, would be to do this same thing, but only on the `os` implementation, and only if the initializer is `const` (i.e. split const initializers to a different macro arm; currently const and non-const initializers generate the same code under the `os` `thread_local!` implementation).

Fixes rust-lang#159538

Fixes rust-lang#159640 (assuming the non-`const`-initializer part of this PR is not removed)
…info, r=beetrees

hir_typeck: simplify `upvar::determine_capture_info` impl
Document `rustc_abi::VariantLayout`

Follow-up to rust-lang#151742.

cc @saethlin @moulins @RalfJung as you were involved with the original PR
…, r=clarfonthey

Stabilize SyncView

This is a stabilization PR for rust-lang#98407.

Closes rust-lang#98407.
Option, Result: not all arguments passed to map_or are eagerly evaluated

The 2nd argument is a closure, which is lazily evaluated. I this this text was copied from other methods like `ok_or` that only have a single argument.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 26, 2026
@rustbot rustbot added F-explicit_tail_calls `#![feature(explicit_tail_calls)]` 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 26, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

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

@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ea2a3d8 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 26, 2026
@rust-bors

This comment has been minimized.

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


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-gnu-llvm-21-3
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 26, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #150824 (Document platform-specific behavior of `current_exe`, including that Linux can add `" (deleted)"`)
 - #159564 (Allow elided ('static) lifetimes in `thread_local!`)
 - #163026 (hir_typeck: simplify `upvar::determine_capture_info` impl)
 - #163256 (Document `rustc_abi::VariantLayout`)
 - #163366 (Stabilize SyncView)
 - #163376 (Option, Result: not all arguments passed to map_or are eagerly evaluated)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 26, 2026
@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 895d5ee failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors retry

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

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 74704df (74704df9aecd151706e5ac20974ee4c139275aa4)
Base parent: a22b02e (a22b02eaecd6ac937d752139c79d0159c725932d)

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

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 10s
Pushing 75a75c3 to main...

@rust-bors
rust-bors Bot merged commit 75a75c3 into rust-lang:main Sep 26, 2026
15 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Sep 26, 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 0b80633 (parent) -> 75a75c3 (this PR)

Test differences

Show 54 test diffs

Stage 1

  • sync_view_access: [missing] -> pass (J2)
  • sync_view_const: [missing] -> pass (J2)
  • sync_view_forwarding: [missing] -> pass (J2)
  • sync_view_pinned_projection: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/suggestions/missing-lifetime-specifier.rs: pass -> [missing] (J5)
  • [ui (polonius)] tests/ui/thread-local/lifetime-elision.rs: [missing] -> pass (J5)
  • [ui] tests/ui/suggestions/missing-lifetime-specifier.rs: pass -> [missing] (J6)
  • [ui] tests/ui/thread-local/lifetime-elision.rs: [missing] -> pass (J6)

Stage 2

  • [ui] tests/ui/suggestions/missing-lifetime-specifier.rs: ignore (ignored when the operating system is android (does not use #[thread_local])) -> [missing] (J0)
  • sync_view_access: [missing] -> pass (J1)
  • sync_view_const: [missing] -> pass (J1)
  • sync_view_forwarding: [missing] -> pass (J1)
  • sync_view_pinned_projection: [missing] -> pass (J1)
  • [ui] tests/ui/suggestions/missing-lifetime-specifier.rs: pass -> [missing] (J3)
  • [ui] tests/ui/thread-local/lifetime-elision.rs: [missing] -> pass (J4)

Additionally, 39 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 75a75c3e0a67d3fa3d03982775f5bb0356e7b510 --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-x86_64-gnu: 2h 39m -> 1h 33m (-41.1%)
  2. test-x86_64-gnu-nopt: 1h 45m -> 2h 29m (+41.1%)
  3. test-x86_64-gnu-llvm-22-3: 1h 19m -> 1h 51m (+39.2%)
  4. test-x86_64-msvc-ext2: 1h 22m -> 1h 53m (+38.4%)
  5. test-x86_64-mingw-2: 2h 5m -> 2h 46m (+33.2%)
  6. dist-i686-linux: 1h 27m -> 1h 55m (+32.0%)
  7. test-x86_64-gnu-debug: 1h 32m -> 2h 2m (+31.7%)
  8. test-x86_64-gnu-parallel-frontend: 1h 21m -> 1h 47m (+31.5%)
  9. test-x86_64-mingw-1: 2h 19m -> 2h 58m (+28.1%)
  10. dist-x86_64-freebsd: 1h 12m -> 1h 32m (+27.4%)
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 (75a75c3): comparison URL.

Overall result: ✅ 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.5%, secondary 2.7%)

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

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

Cycles

Results (primary 2.1%, secondary 0.8%)

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

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

Binary size

Results (primary 0.5%)

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

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.5%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.4%, 0.5%] 4

Bootstrap: 491.179s -> 487.818s (-0.68%)
Artifact size: 406.25 MiB -> 406.33 MiB (0.02%)

@rust-bors

rust-bors Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#150824 Document platform-specific behavior of current_exe, inclu… c200fd4984419b9839db1fd27b9447ad0284bdf3
(link)
#159564 Allow elided ('static) lifetimes in thread_local! 857a35b8a3b55cd89b095596ebf421ea0c9d2988
(link)
#163026 hir_typeck: simplify upvar::determine_capture_info impl e9f0d121b1d71f92dfbd4a1214bb16e1ff8e2449
(link)
#163256 Document rustc_abi::VariantLayout 8b73c5fb60a35de6998d5518cb256090f2b74ebb
(link)
#163366 Stabilize SyncView e57058df10e81a9b9b729708e66dbccd544e2f19
(link)
#163376 Option, Result: not all arguments passed to map_or are eage… c2932ebf4da318ddbdc07d5d066cca9dd745f060
(link)

parent commit: 0b80633005

In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: @rust-timer triage $SHA $SHA $SHA..., or run @rust-timer triage all to benchmark all rollup members.

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

Labels

F-explicit_tail_calls `#![feature(explicit_tail_calls)]` 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.

9 participants