-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
fn foo() {}
fn bar() {}
fn baz() {}
I expected to see this happen:
error[E0601]: `main` function not found in crate `hello`
--> src/main.rs:4:1
3 | | fn baz() {}
4 | ^ consider adding a `main` function to `src/main.rs`
(or something similar -- an empty last line might be missing).
Instead, this happened:
error[E0601]: `main` function not found in crate `hello`
--> src/main.rs:1:1
|
1 | / fn foo() {}
2 | | fn bar() {}
3 | | fn baz() {}
| |___________^ consider adding a `main` function to `src/main.rs`
This matters for IDE support, because using the whole file as an error span is a bit messy, marking potentially hundreds of lines as an error.
Meta
rustc --version
:
rustc 1.49.0-nightly (91a79fb29 2020-10-07)
tesuji and lukechu10
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.