diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2021-05-03 11:39:10 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2021-05-18 11:22:04 -0700 |
| commit | 641d3b09f41b441f2c2618de32983ad3d13ea3f8 (patch) | |
| tree | b170d00257ffb463cba8b5d235622d7aa13f0f43 /src/test/codegen/auxiliary | |
| parent | 716394d6581b60c75cfdd88b8e5b876f2db88b62 (diff) | |
| download | rust-641d3b09f41b441f2c2618de32983ad3d13ea3f8.tar.gz rust-641d3b09f41b441f2c2618de32983ad3d13ea3f8.zip | |
std: Attempt again to inline thread-local-init across crates
Issue #25088 has been part of `thread_local!` for quite some time now. Historical attempts have been made to add `#[inline]` to `__getit` in #43931, #50252, and #59720, but these attempts ended up not landing at the time due to segfaults on Windows. In the interim though with `const`-initialized thread locals AFAIK this is the only remaining bug which is why you might want to use `#[thread_local]` over `thread_local!`. As a result I figured it was time to resubmit this and see how it fares on CI and if I can help debugging any issues that crop up. Closes #25088
Diffstat (limited to 'src/test/codegen/auxiliary')
| -rw-r--r-- | src/test/codegen/auxiliary/thread_local_aux.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/codegen/auxiliary/thread_local_aux.rs b/src/test/codegen/auxiliary/thread_local_aux.rs new file mode 100644 index 00000000000..29b5e3ca244 --- /dev/null +++ b/src/test/codegen/auxiliary/thread_local_aux.rs @@ -0,0 +1,6 @@ +#![crate_type = "lib"] +#![feature(thread_local_const_init)] + +use std::cell::Cell; + +thread_local!(pub static A: Cell<u64> = const { Cell::new(0) }); |
