1
Fork 0

Add test for a still ambiguous scenario

This commit is contained in:
Santiago Pastorino 2020-11-20 11:22:36 -03:00
parent 3c8cf6d802
commit a6d2235de1
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,10 @@
trait Foo {
type Item;
}
trait Bar<T> {
type Item;
}
trait Baz: Foo + Bar<Self::Item> {}
//~^ ERROR cycle detected when computing the supertraits of `Baz` [E0391]
fn main() {}

View file

@ -0,0 +1,16 @@
error[E0391]: cycle detected when computing the supertraits of `Baz`
--> $DIR/ambiguous-associated-type2.rs:7:1
|
LL | trait Baz: Foo + Bar<Self::Item> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which again requires computing the supertraits of `Baz`, completing the cycle
note: cycle used when computing the supertraits of `Baz`
--> $DIR/ambiguous-associated-type2.rs:7:1
|
LL | trait Baz: Foo + Bar<Self::Item> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0391`.