Closed
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)