summaryrefslogtreecommitdiffstats
path: root/src/test/ui/specialization/issue-39618.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/specialization/issue-39618.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/specialization/issue-39618.rs b/src/test/ui/specialization/issue-39618.rs
new file mode 100644
index 000000000..72630ee9c
--- /dev/null
+++ b/src/test/ui/specialization/issue-39618.rs
@@ -0,0 +1,27 @@
+// Regression test for #39618, shouldn't crash.
+// FIXME(JohnTitor): Centril pointed out this looks suspicions, we should revisit here.
+// More context: https://github.com/rust-lang/rust/pull/69192#discussion_r379846796
+
+// check-pass
+
+#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
+
+trait Foo {
+ fn foo(&self);
+}
+
+trait Bar {
+ fn bar(&self);
+}
+
+impl<T> Bar for T where T: Foo {
+ fn bar(&self) {}
+}
+
+impl<T> Foo for T where T: Bar {
+ fn foo(&self) {}
+}
+
+impl Foo for u64 {}
+
+fn main() {}