Skip to content

Add help message for static method call of a struct #101637

Closed
@chenyukang

Description

@chenyukang
struct Demo {}

impl Demo {
    fn func() {}
}

fn main() {
    Dem::func();
}

Current output:

error[E0433]: failed to resolve: use of undeclared type `Dem`
 --> strcuct.rs:8:5
  |
8 |     Dem::func();
  |     ^^^ use of undeclared type `Dem`

error: aborting due to previous error

Expect to have a tip from Levenshtein algorithm.

9 |     Dem::func();
  |     ^^^
help: a struct with a similar name exists
  |
9 |     Demo::func();
  |     ~~~~

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions