We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e11a9fa commit cbd647fCopy full SHA for cbd647f
1 file changed
src/test/ui/thread-local-issue-37508.rs
@@ -0,0 +1,22 @@
1
+// compile-flags: --crate-type rlib -C opt-level=3 -C code-model=large
2
+// build-pass
3
+
4
+#![no_std]
5
+#![feature(thread_local)]
6
7
+pub struct BB;
8
9
+#[thread_local]
10
+static mut KEY: Key = Key { inner: BB, dtor_running: false };
11
12
+pub unsafe fn set() -> Option<&'static BB> {
13
+ if KEY.dtor_running {
14
+ return None;
15
+ }
16
+ Some(&KEY.inner)
17
+}
18
19
+pub struct Key {
20
+ inner: BB,
21
+ dtor_running: bool,
22
0 commit comments