From e1f630f23de2cbce1870e4a226fa0cb8312f106c Mon Sep 17 00:00:00 2001
From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date: Mon, 16 Jan 2023 18:50:45 +0100
Subject: [PATCH] Add `OnceCell<T>: !Sync` impl for diagnostics

---
 library/core/src/cell/once.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/library/core/src/cell/once.rs b/library/core/src/cell/once.rs
index 7757068a4f2..f74e563f1b9 100644
--- a/library/core/src/cell/once.rs
+++ b/library/core/src/cell/once.rs
@@ -298,3 +298,7 @@ impl<T> const From<T> for OnceCell<T> {
         OnceCell { inner: UnsafeCell::new(Some(value)) }
     }
 }
+
+// Just like for `Cell<T>` this isn't needed, but results in nicer error messages.
+#[unstable(feature = "once_cell", issue = "74465")]
+impl<T> !Sync for OnceCell<T> {}