diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-10-02 10:27:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-02 10:27:48 +0200 |
| commit | 92aac1bdf61642cfc99498ca86e663cf53d2039e (patch) | |
| tree | 20241a81c901b8835022b90eddaed6b375e23f30 /library/std/tests | |
| parent | 42b384ec0dfcd528d99a4db0a337d9188a9eecaa (diff) | |
| parent | 94f00f4e4a0240bc7b8284c78482e37af252309a (diff) | |
Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, r=Mark-Simulacrum
Support `#[rustc_align_static]` inside `thread_local!`
Tracking issue: rust-lang/rust#146177
```rust
thread_local! {
#[rustc_align_static(64)]
static SO_ALIGNED: u64 = const { 0 };
}
```
This increases the amount of recursion the macro performs (once per attribute in addition to the previous once per item), making it easier to hit the recursion limit. I’ve added workarounds to limit the impact in the case of long doc comments, but this still needs a crater run just in case.
r? libs
``@rustbot`` label A-attributes A-macros A-thread-locals F-static_align T-libs
Diffstat (limited to 'library/std/tests')
| -rw-r--r-- | library/std/tests/thread.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/tests/thread.rs b/library/std/tests/thread.rs index 29f220d8a70..dc8eadd7514 100644 --- a/library/std/tests/thread.rs +++ b/library/std/tests/thread.rs @@ -66,6 +66,8 @@ fn thread_local_hygeiene() { type Storage = (); type LazyStorage = (); type EagerStorage = (); + #[allow(non_camel_case_types)] + type usize = (); thread_local! { static A: LocalKey = const { () }; static B: Storage = const { () }; |
