]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/threads-sendsync/issue-43733.rs
Rollup merge of #96415 - ehuss:git-io, r=bjorn3
[rust.git] / src / test / ui / threads-sendsync / issue-43733.rs
index 5434140cd61280b7bc7f6d06eed501b815aac9f3..e613c2b03e63b21163a0af45103e1db5a9851668 100644 (file)
@@ -1,9 +1,13 @@
 // revisions: mir thir
 // [thir]compile-flags: -Z thir-unsafeck
+// normalize-stderr-test: "__FastLocalKeyInner::<T>::get" -> "$$LOCALKEYINNER::<T>::get"
+// normalize-stderr-test: "__OsLocalKeyInner::<T>::get" -> "$$LOCALKEYINNER::<T>::get"
 
 #![feature(thread_local)]
 #![feature(cfg_target_thread_local, thread_local_internals)]
 
+use std::cell::RefCell;
+
 type Foo = std::cell::RefCell<String>;
 
 #[cfg(target_thread_local)]
 #[cfg(not(target_thread_local))]
 static __KEY: std::thread::__OsLocalKeyInner<Foo> = std::thread::__OsLocalKeyInner::new();
 
-fn __getit() -> std::option::Option<&'static Foo> {
-    __KEY.get(Default::default) //~ ERROR call to unsafe function is unsafe
+fn __getit(_: Option<&mut Option<RefCell<String>>>) -> std::option::Option<&'static Foo> {
+    __KEY.get(Default::default)
+    //[mir]~^ ERROR call to unsafe function `std::thread::
+    //[thir]~^^ ERROR call to unsafe function `__
 }
 
 static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit);
-//~^ ERROR call to unsafe function is unsafe
+//[mir]~^ ERROR call to unsafe function `std::thread::LocalKey::<T>::new` is unsafe
+//[thir]~^^ ERROR call to unsafe function `LocalKey::<T>::new` is unsafe
 
 fn main() {
     FOO.with(|foo| println!("{}", foo.borrow()));