Skip to content

Check for static methods of the same name when calling an non-existent method #11627

Closed
@huonw

Description

@huonw

e.g.

struct Foo;
impl Foo {
    fn function() {}
}

fn main() {
    Foo.function();
}

The error, "Foo does not implement any method in scope named function", could have a note "maybe you meant to call the non-method Foo::function(...)".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions