-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.P-lowLow priorityLow priorityT-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
The following snippet is not correct:
trait Bar {}
trait Foo where Foo::Assoc: Bar {
type Assoc;
}
But these three are:
trait Foo where Self::Assoc: Bar {
type Assoc;
}
trait Foo where <Self as Foo>::Assoc: Bar {
type Assoc;
}
trait Foo {
type Assoc: Bar;
}
For the first we currently emit:
error[E0223]: ambiguous associated type
--> file.rs:3:17
|
3 | trait Foo where Foo::Assoc: Bar {
| ^^^^^^^^^^ help: use fully-qualified syntax: `<Type as Foo>::Assoc`
but it should suggest one of the two valid snippets above.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.P-lowLow priorityLow priorityT-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.