Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compiler help for missing module error (E0583) #84819

Closed
Zerotask opened this issue May 2, 2021 · 1 comment · Fixed by #84945
Closed

Improve compiler help for missing module error (E0583) #84819

Zerotask opened this issue May 2, 2021 · 1 comment · Fixed by #84945
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Zerotask
Copy link

Zerotask commented May 2, 2021

I created a fresh project with cargo init, a new empty folder user
image

and my main.rs looks as following:

mod user;

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

If I execute cargo run, the compiler gives me the help:
image

Since I created a folder user the compiler could also suggest adding a src\user\mod.rs.

My suggested help for this case would be:

= help: to create the module `user`, create file "src\user.rs" or "src\user\mod.rs"

The compiler could always show this help, not only if there is a folder with that name.

@Zerotask Zerotask changed the title Improve compiler hint for missing module Improve compiler help for missing module error May 2, 2021
@Zerotask Zerotask changed the title Improve compiler help for missing module error Improve compiler help for missing module error (E0583) May 2, 2021
@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels May 4, 2021
@fee1-dead
Copy link
Member

@rustbot claim

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 5, 2021
…etrochenkov

E0583: Include secondary path in error message

Fixes rust-lang#84819.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 6, 2021
…etrochenkov

E0583: Include secondary path in error message

Fixes rust-lang#84819.
@bors bors closed this as completed in b07834b May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants