-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
There're two known compiler errors that provide no location information:
error: main function not found
error: aborting due to previous error
It holds true for both the standard output and the JSON error format.
While the latter is a meta error and obviously is not related to a particular place in the source code, the former one could at least come with a file name. It would be of use to both humans and IDEs, particularly when there're several executables in a single project (in the examples
or src/bin
folders).
Since there's always a particular file in which rustc
is looking for the main()
function, this file name should be mentioned in the message either with the 1:1
position, or with no position at all. This would let the user or IDE to quickly jump directly to the file in which the problem must be fixed.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.