Open
Description
I don't know if this is a bug or expected behaviour. But I'm encountering the following error when compiling the following code.
#![feature(associated_type_bounds)]
trait A {
type T;
}
trait B: A<T: B> {}
error[E0391]: cycle detected when computing the supertraits of `B`
--> src/main.rs:6:15
|
6 | trait B: A<T: B> {}
| ^
|
= note: ...which again requires computing the supertraits of `B`, completing the cycle
note: cycle used when collecting item types in top-level module
--> src/main.rs:6:1
|
6 | trait B: A<T: B> {}
| ^^^^^^^^^^^^^^^^
But if I merge the traits A
and B
into the trait C
it works.
trait C {
type T: C;
}
I think the first example should work as good as the second since the trait C
is only split into two traits A
and B
with same functionality.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Trait systemDiagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.`#![feature(associated_type_bounds)]`Issue: A query cycle occurred while none was expectedRelevant to the compiler team, which will review and decide on the PR/issue.