Skip to content

Disable no_threads compiler errors for Trusty targets - #165728

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
randomPoison:trusty-std-no-threads
Nov 10, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
randomPoison:trusty-std-no-threads

Conversation

@randomPoison

@randomPoison randomPoison commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

#158782 introduced compile-time checks to verify that targets using the no-thread implementation of sync primitives are actually marked single-threaded. This broke the Trusty targets, which are not marked single-threaded but are using the no-threads implementations. Trusty userspace doesn't have threads, but we can't mark the target single-threaded because we need atomic operations for shared-memory IPC. This PR adds an exception to the #[cfg] on the compile_error! to allow Trusty to use the no-thread sync implementations.

Fixes #165596

@rustbot rustbot added A-thread Area: `std::thread` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 9, 2026
@rustbot

rustbot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

r? @nia-e

rustbot has assigned @nia-e.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 38 candidates
  • Random selection from JohnTitor, LawnGnome, Mark-Simulacrum, maxdexh, nia-e

@workingjubilee

Copy link
Copy Markdown
Member

...hmm.

...no one does do anything wild like shove a Mutex<T> inside shmem, right?

@joboet

joboet commented Nov 10, 2026

Copy link
Copy Markdown
Member

Yes, that'd be a bad idea. This approach is the right one, Trusty isn't the only target where concurrency exists but is incompatible with std usage.

@bors r+ rollup
r? joboet

@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7e4758f has been approved by joboet

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 Nov 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
…, r=joboet

Disable no_threads compiler errors for Trusty targets

rust-lang#158782 introduced compile-time checks to verify that targets using the no-thread implementation of sync primitives are actually marked single-threaded. This broke the Trusty targets, which are not marked single-threaded but are using the no-threads implementations. Trusty userspace doesn't have threads, but we can't mark the target single-threaded because we need atomic operations for shared-memory IPC. This PR adds an exception to the `#[cfg]` on the `compile_error!` to allow Trusty to use the no-thread sync implementations.

Fixes rust-lang#165596
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #158970 (Support underscore as associated const name in inherent impls)
 - #165192 (BPF: Define max/min atomic width per CPU version)
 - #165611 (Avoid terminator: None in MIR building)
 - #165749 (Improve duplicate attribute diagnostics for active built-in attributes)
 - #165762 (Fix `x bench library/std`)
 - #165726 ([rustdoc-frontend] Properly clear search state when sidebar link is clicked)
 - #165728 (Disable no_threads compiler errors for Trusty targets)
 - #165754 (rustdoc: Rename `--show-coverage` CLI flag into `--coverage`)
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #165192 (BPF: Define max/min atomic width per CPU version)
 - #165611 (Avoid terminator: None in MIR building)
 - #165749 (Improve duplicate attribute diagnostics for active built-in attributes)
 - #165762 (Fix `x bench library/std`)
 - #165726 ([rustdoc-frontend] Properly clear search state when sidebar link is clicked)
 - #165728 (Disable no_threads compiler errors for Trusty targets)
 - #165754 (rustdoc: Rename `--show-coverage` CLI flag into `--coverage`)
@rust-bors
rust-bors Bot merged commit 57bad6d into rust-lang:main Nov 10, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 10, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
Rollup merge of #165728 - randomPoison:trusty-std-no-threads, r=joboet

Disable no_threads compiler errors for Trusty targets

#158782 introduced compile-time checks to verify that targets using the no-thread implementation of sync primitives are actually marked single-threaded. This broke the Trusty targets, which are not marked single-threaded but are using the no-threads implementations. Trusty userspace doesn't have threads, but we can't mark the target single-threaded because we need atomic operations for shared-memory IPC. This PR adds an exception to the `#[cfg]` on the `compile_error!` to allow Trusty to use the no-thread sync implementations.

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

Labels

A-thread Area: `std::thread` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

*-trusty targets build failed

5 participants