- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-trait-systemArea: Trait systemArea: Trait systemD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
trait A<T> {}
trait B {
    type Type;
}
impl<T> B for T
where
    T: A<Self::Type>,
{
    type Type = bool;
}Current output
error[E0275]: overflow evaluating the requirement `<T as B>::Type == <T as B>::Type`
 --> src/lib.rs:7:1
  |
7 | / impl<T> B for T
8 | | where
9 | |     T: A<Self::Type>,
  | |_____________________^
  |
note: required for `T` to implement `B`
 --> src/lib.rs:7:9
  |
7 | impl<T> B for T
  |         ^     ^
8 | where
9 |     T: A<Self::Type>,
  |        ------------- unsatisfied trait bound introduced here
For more information about this error, try `rustc --explain E0275`.Desired output
an explanation that `Self::Type` does not reference `bool` but tries to figure out whether T already implements BRationale and extra context
spawned from #116914
Other cases
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-trait-systemArea: Trait systemArea: Trait systemD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.