about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-01-16 18:50:45 +0100
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-01-19 20:14:21 +0100
commite1f630f23de2cbce1870e4a226fa0cb8312f106c (patch)
tree2704e3e77821f6e29c5b65893e53acead6325c0f
parent19423b59440f464c6cbe6be442d447e37b50fe3c (diff)
downloadrust-e1f630f23de2cbce1870e4a226fa0cb8312f106c.tar.gz
rust-e1f630f23de2cbce1870e4a226fa0cb8312f106c.zip
Add `OnceCell<T>: !Sync` impl for diagnostics
-rw-r--r--library/core/src/cell/once.rs4
1 files changed, 4 insertions, 0 deletions
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> {}