summaryrefslogtreecommitdiffstats
path: root/src/test/ui/no_share-struct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/no_share-struct.rs')
-rw-r--r--src/test/ui/no_share-struct.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/no_share-struct.rs b/src/test/ui/no_share-struct.rs
new file mode 100644
index 000000000..7d8a36a76
--- /dev/null
+++ b/src/test/ui/no_share-struct.rs
@@ -0,0 +1,14 @@
+#![feature(negative_impls)]
+
+use std::marker::Sync;
+
+struct Foo { a: isize }
+impl !Sync for Foo {}
+
+fn bar<T: Sync>(_: T) {}
+
+fn main() {
+ let x = Foo { a: 5 };
+ bar(x);
+ //~^ ERROR `Foo` cannot be shared between threads safely [E0277]
+}