summaryrefslogtreecommitdiffstats
path: root/tests/ui/sync/suggest-ref-cell.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/sync/suggest-ref-cell.rs')
-rw-r--r--tests/ui/sync/suggest-ref-cell.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/sync/suggest-ref-cell.rs b/tests/ui/sync/suggest-ref-cell.rs
new file mode 100644
index 000000000..6b972ae09
--- /dev/null
+++ b/tests/ui/sync/suggest-ref-cell.rs
@@ -0,0 +1,12 @@
+#![feature(once_cell)]
+
+fn require_sync<T: Sync>() {}
+//~^ NOTE required by this bound in `require_sync`
+//~| NOTE required by a bound in `require_sync`
+
+fn main() {
+ require_sync::<std::cell::RefCell<()>>();
+ //~^ ERROR `RefCell<()>` cannot be shared between threads safely
+ //~| NOTE `RefCell<()>` cannot be shared between threads safely
+ //~| NOTE use `std::sync::RwLock` instead
+}