about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/associated-type-bounds/implied-bounds-cycle.rs10
-rw-r--r--tests/ui/associated-type-bounds/implied-bounds-cycle.stderr17
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/associated-type-bounds/implied-bounds-cycle.rs b/tests/ui/associated-type-bounds/implied-bounds-cycle.rs
new file mode 100644
index 00000000000..785d47d4791
--- /dev/null
+++ b/tests/ui/associated-type-bounds/implied-bounds-cycle.rs
@@ -0,0 +1,10 @@
+#![feature(associated_type_bounds)]
+
+trait A {
+    type T;
+}
+
+trait B: A<T: B> {}
+//~^ ERROR cycle detected when computing the implied predicates of `B`
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr
new file mode 100644
index 00000000000..1c1c64ea5f5
--- /dev/null
+++ b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr
@@ -0,0 +1,17 @@
+error[E0391]: cycle detected when computing the implied predicates of `B`
+  --> $DIR/implied-bounds-cycle.rs:7:15
+   |
+LL | trait B: A<T: B> {}
+   |               ^
+   |
+   = note: ...which immediately requires computing the implied predicates of `B` again
+note: cycle used when computing normalized predicates of `B`
+  --> $DIR/implied-bounds-cycle.rs:7:1
+   |
+LL | trait B: A<T: B> {}
+   | ^^^^^^^^^^^^^^^^
+   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0391`.