-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
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`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
Here is a small example to reproduce the error and its help message:
trait A {
type Item;
}
trait B {
type Item: A;
fn trait_fn(x: Self::Item::Item);
}
Then I get the following error:
error[E0223]: ambiguous associated type
--> src/main.rs:8:20
|
8 | fn trait_fn(x: Self::Item::Item);
| ^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<<Self as B>::Item as Trait>::Item`
It looks like the word "Trait
" in <<Self as B>::Item as Trait>::Item
should be replaced with the trait name A
so that the suggested expression compiles:
help: use fully-qualified syntax: <<Self as B>::Item as A>::Item
.
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`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.