summaryrefslogtreecommitdiffstats
path: root/src/test/ui/specialization/specialization-polarity.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/specialization/specialization-polarity.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/specialization/specialization-polarity.rs b/src/test/ui/specialization/specialization-polarity.rs
new file mode 100644
index 000000000..b3cd8255b
--- /dev/null
+++ b/src/test/ui/specialization/specialization-polarity.rs
@@ -0,0 +1,17 @@
+// Make sure specialization cannot change impl polarity
+
+#![feature(auto_traits)]
+#![feature(negative_impls)]
+#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
+
+auto trait Foo {}
+
+impl<T> Foo for T {}
+impl !Foo for u8 {} //~ ERROR E0751
+
+auto trait Bar {}
+
+impl<T> !Bar for T {}
+impl Bar for u8 {} //~ ERROR E0751
+
+fn main() {}