Skip to content

rust could suggest "use" if it finds something like "import ... crate::" #97788

Closed
@matthiaskrgr

Description

Given the following code:

mod a;
import crate::a::*;

fn main() {
    a();
    println!("Hello, world!");
}

The current output is:

error: expected one of `!` or `::`, found keyword `crate`
 --> src/main.rs:2:8
  |
2 | import crate::a::*;
  |        ^^^^^ expected one of `!` or `::`

Ideally the output should look like:

found keyword `import` did you instead intend to use `use` instead?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsD-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.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