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