Skip to content

Commit a6d2235

Browse files
committed
Add test for a still ambiguous scenario
1 parent 3c8cf6d commit a6d2235

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
trait Foo {
2+
type Item;
3+
}
4+
trait Bar<T> {
5+
type Item;
6+
}
7+
trait Baz: Foo + Bar<Self::Item> {}
8+
//~^ ERROR cycle detected when computing the supertraits of `Baz` [E0391]
9+
10+
fn main() {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0391]: cycle detected when computing the supertraits of `Baz`
2+
--> $DIR/ambiguous-associated-type2.rs:7:1
3+
|
4+
LL | trait Baz: Foo + Bar<Self::Item> {}
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: ...which again requires computing the supertraits of `Baz`, completing the cycle
8+
note: cycle used when computing the supertraits of `Baz`
9+
--> $DIR/ambiguous-associated-type2.rs:7:1
10+
|
11+
LL | trait Baz: Foo + Bar<Self::Item> {}
12+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0391`.

0 commit comments

Comments
 (0)