Skip to content

Clarify error on ambiguous associated type ("Try using Iterator" instead of "X as Trait") #46585

Closed
@binary132

Description

@binary132

Hi, I think this error message is unclear.

https://play.rust-lang.org/?gist=5b08c55cf63a625ced0cbaf83b4db0de&version=stable

The solution is here:

https://play.rust-lang.org/?gist=3ce26cc2d8cbd16533b884a1f8f76900&version=stable

@oli-obk suggested mentoring a PR to add a suggestion for possible trait types in the impl. This Issue serves as a starting point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions