diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 060a6fa903f46..99701898b030c 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -3994,8 +3994,6 @@ ui/test-attrs/issue-52557.rs ui/test-attrs/issue-53675-a-test-called-panic.rs ui/threads-sendsync/issue-24313.rs ui/threads-sendsync/issue-29488.rs -ui/threads-sendsync/issue-43733-2.rs -ui/threads-sendsync/issue-43733.rs ui/threads-sendsync/issue-4446.rs ui/threads-sendsync/issue-4448.rs ui/threads-sendsync/issue-8827.rs diff --git a/tests/ui/threads-sendsync/issue-43733-2.rs b/tests/ui/threads-sendsync/issue-43733-2.rs deleted file mode 100644 index 372ebf2cff97f..0000000000000 --- a/tests/ui/threads-sendsync/issue-43733-2.rs +++ /dev/null @@ -1,30 +0,0 @@ -//@ needs-threads -//@ dont-check-compiler-stderr -#![feature(cfg_target_thread_local, thread_local_internals)] - -// On platforms *without* `#[thread_local]`, use -// a custom non-`Sync` type to fake the same error. -#[cfg(not(target_thread_local))] -struct Key { - _data: std::cell::UnsafeCell>, - _flag: std::cell::Cell<()>, -} - -#[cfg(not(target_thread_local))] -impl Key { - const fn new() -> Self { - Key { - _data: std::cell::UnsafeCell::new(None), - _flag: std::cell::Cell::new(()), - } - } -} - -#[cfg(target_thread_local)] -use std::thread::local_impl::Key; - -static __KEY: Key<()> = Key::new(); -//~^ ERROR `UnsafeCell>` cannot be shared between threads -//~| ERROR cannot be shared between threads safely [E0277] - -fn main() {} diff --git a/tests/ui/threads-sendsync/issue-43733.rs b/tests/ui/threads-sendsync/issue-43733.rs deleted file mode 100644 index c90f60887cfd2..0000000000000 --- a/tests/ui/threads-sendsync/issue-43733.rs +++ /dev/null @@ -1,32 +0,0 @@ -//@ needs-threads -#![feature(thread_local)] -#![feature(cfg_target_thread_local, thread_local_internals)] - -use std::cell::RefCell; - -type Foo = std::cell::RefCell; - -#[cfg(target_thread_local)] -#[thread_local] -static __KEY: std::thread::local_impl::Key = std::thread::local_impl::Key::new(); - -#[cfg(not(target_thread_local))] -static __KEY: std::thread::local_impl::Key = std::thread::local_impl::Key::new(); - -fn __getit(_: Option<&mut Option>>) -> std::option::Option<&'static Foo> { - __KEY.get(Default::default) - //~^ ERROR call to unsafe function `Key::::get` is unsafe -} - -static FOO: std::thread::LocalKey = std::thread::LocalKey::new(__getit); -//~^ ERROR call to unsafe function `LocalKey::::new` is unsafe - -fn main() { - FOO.with(|foo| println!("{}", foo.borrow())); - std::thread::spawn(|| { - FOO.with(|foo| *foo.borrow_mut() += "foo"); - }) - .join() - .unwrap(); - FOO.with(|foo| println!("{}", foo.borrow())); -} diff --git a/tests/ui/threads-sendsync/issue-43733.stderr b/tests/ui/threads-sendsync/issue-43733.stderr deleted file mode 100644 index 9b13646a22852..0000000000000 --- a/tests/ui/threads-sendsync/issue-43733.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: call to unsafe function `Key::::get` is unsafe and requires unsafe function or block - --> $DIR/issue-43733.rs:17:5 - | -LL | __KEY.get(Default::default) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function `LocalKey::::new` is unsafe and requires unsafe function or block - --> $DIR/issue-43733.rs:21:42 - | -LL | static FOO: std::thread::LocalKey = std::thread::LocalKey::new(__getit); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`.