summaryrefslogtreecommitdiffstats
path: root/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs')
-rw-r--r--src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs
new file mode 100644
index 000000000..e716489c2
--- /dev/null
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs
@@ -0,0 +1,14 @@
+// Test for traits that inherit from multiple builtin kinds at once,
+// testing that all such kinds must be present on implementing types.
+
+trait Foo : Send+Sync { }
+
+impl <T: Sync+'static> Foo for (T,) { }
+//~^ ERROR `T` cannot be sent between threads safely [E0277]
+
+impl <T: Send> Foo for (T,T) { }
+//~^ ERROR `T` cannot be shared between threads safely [E0277]
+
+impl <T: Send+Sync> Foo for (T,T,T) { } // (ok)
+
+fn main() { }