Skip to content

Deny #[global_allocator] + #[thread_local]#155071

Merged
rust-bors[bot] merged 5 commits intorust-lang:mainfrom
Fayti1703:alloc/no-thread-local
Apr 10, 2026
Merged

Deny #[global_allocator] + #[thread_local]#155071
rust-bors[bot] merged 5 commits intorust-lang:mainfrom
Fayti1703:alloc/no-thread-local

Conversation

@Fayti1703
Copy link
Copy Markdown
Contributor

@Fayti1703 Fayti1703 commented Apr 9, 2026

This forbids using #[thread_local] on static items that are also #[global_allocator]s.

Fixes #85517.

@rustbot rustbot added 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. labels Apr 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Apr 10, 2026

r? me @bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

📌 Commit b537c45 has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 10, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 10, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 10, 2026
Rollup of 10 pull requests

Successful merges:

 - #154973 (Break a single query cycle in the deadlock handler)
 - #155034 (Implement `GenericTypeVisitable` for some types)
 - #151377 (Fix linker error by resolving regions for main return type obligations)
 - #154677 (hwaddress: automatically add `-Ctarget-feature=+tagged-globals`)
 - #154774 (Add myself as co-maintainer for hexagon-unknown-linux-musl)
 - #155015 (Add tests for three fixed issues (an LLVM crash, an ICE and poor codegen))
 - #155039 (minor follow up to removing soft mode `#[unstable]`)
 - #155043 (Fix if branch in op.rs)
 - #155071 (Deny `#[global_allocator]` + `#[thread_local]`)
 - #155072 (Set the Fuchsia ABI to the documented minimum)
@rust-bors rust-bors bot merged commit c305a1a into rust-lang:main Apr 10, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 10, 2026
rust-timer added a commit that referenced this pull request Apr 10, 2026
Rollup merge of #155071 - Fayti1703:alloc/no-thread-local, r=Kivooeo

Deny `#[global_allocator]` + `#[thread_local]`

This forbids using `#[thread_local]` on `static` items that are also `#[global_allocator]`s.

Fixes #85517.
@nabby-likes-to-code
Copy link
Copy Markdown

Thats my friend of a friend of a friend of a friend!

@Fayti1703 Fayti1703 deleted the alloc/no-thread-local branch April 10, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#[global_allocator] and #[thread_local] should not be usable together on the same static

5 participants