Add test for a still ambiguous scenario
This commit is contained in:
parent
3c8cf6d802
commit
a6d2235de1
2 changed files with 26 additions and 0 deletions
|
@ -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() {}
|
|
@ -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`.
|
Loading…
Add table
Add a link
Reference in a new issue