Skip to content

Suggest which trait to import if method lookup fails #2508

@catamorphism

Description

@catamorphism

This may be a dup, but http://pastebin.com/KkCdjmRS suggests that this error message could be improved:

arguments.rs:17:8: 17:14 error: attempted access of field each on type ['a], but no public field or method with that name was found
arguments.rs:17     for v.each {|elt| acc += [f(elt)]; }

This error message could be better, because it doesn't tell the user what they need to do to fix the problem. In this case, the hint "import the module that defines the implementation that defines each" would be helpful. Obviously there is no hint that would always apply, but this would be helpful in many cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions