summaryrefslogtreecommitdiffstats
path: root/src/test/ui/specialization/specialization-feature-gate-overlap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/specialization/specialization-feature-gate-overlap.rs')
-rw-r--r--src/test/ui/specialization/specialization-feature-gate-overlap.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/specialization/specialization-feature-gate-overlap.rs b/src/test/ui/specialization/specialization-feature-gate-overlap.rs
new file mode 100644
index 000000000..b83c84ab8
--- /dev/null
+++ b/src/test/ui/specialization/specialization-feature-gate-overlap.rs
@@ -0,0 +1,17 @@
+// Check that writing an overlapping impl is not allow unless specialization is ungated.
+
+// gate-test-specialization
+
+trait Foo {
+ fn foo(&self);
+}
+
+impl<T> Foo for T {
+ fn foo(&self) {}
+}
+
+impl Foo for u8 { //~ ERROR E0119
+ fn foo(&self) {}
+}
+
+fn main() {}