Skip to content

Commit b148c25

Browse files
committed
fix compile-fail test for targets without thread locals
1 parent 2c37961 commit b148c25

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/compile-fail/issue-43733-2.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
#[cfg(not(target_thread_local))]
66
struct Key<T> {
77
_data: std::cell::UnsafeCell<Option<T>>,
8-
_flag: std::cell::Cell<bool>,
8+
_flag: std::cell::Cell<()>,
99
}
1010

1111
#[cfg(not(target_thread_local))]
1212
impl<T> Key<T> {
1313
const fn new() -> Self {
1414
Key {
1515
_data: std::cell::UnsafeCell::new(None),
16-
_flag: std::cell::Cell::new(false),
16+
_flag: std::cell::Cell::new(()),
1717
}
1818
}
1919
}
@@ -23,7 +23,6 @@ use std::thread::__FastLocalKeyInner as Key;
2323

2424
static __KEY: Key<()> = Key::new();
2525
//~^ ERROR `std::cell::UnsafeCell<std::option::Option<()>>` cannot be shared between threads
26-
//~| ERROR `std::cell::Cell<std::thread::local::fast::DtorState>` cannot be shared between threads
27-
// safely [E0277]
26+
//~| ERROR cannot be shared between threads safely [E0277]
2827

2928
fn main() {}

0 commit comments

Comments
 (0)