-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Error without location #36561
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
steveklabnik
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
and removed
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Mar 9, 2017
Mark-Simulacrum
added
the
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
label
Jul 26, 2017
Current output:
|
@estebank, thank you for the notice, the output surely looks much better now. Though, it still lacks a code reference that would conform with other error messages and could be used by parsers. I mean something like this:
Extracting the file name from the note text, which is a subject to occasional change, doesn't seem like a reliable approach. |
Centril
added a commit
to Centril/rust
that referenced
this issue
Sep 14, 2019
…ebank Provide a span if main function is not present in crate Unfortunately, the diagnostic machinery does not cope well with an empty span which can happen if the crate is empty, in which case we merely set a spanless note. Tests are already updated for this change, so a dedicated test is not added. Resolves rust-lang#36561.
Centril
added a commit
to Centril/rust
that referenced
this issue
Sep 14, 2019
…ebank Provide a span if main function is not present in crate Unfortunately, the diagnostic machinery does not cope well with an empty span which can happen if the crate is empty, in which case we merely set a spanless note. Tests are already updated for this change, so a dedicated test is not added. Resolves rust-lang#36561.
Centril
added a commit
to Centril/rust
that referenced
this issue
Sep 14, 2019
…ebank Provide a span if main function is not present in crate Unfortunately, the diagnostic machinery does not cope well with an empty span which can happen if the crate is empty, in which case we merely set a spanless note. Tests are already updated for this change, so a dedicated test is not added. Resolves rust-lang#36561.
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
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
There're two known compiler errors that provide no location information:
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
orsrc/bin
folders).Since there's always a particular file in which
rustc
is looking for themain()
function, this file name should be mentioned in the message either with the1: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.The text was updated successfully, but these errors were encountered: