-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"file not found for module" compile error doesn't have an error number #39542
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
Comments
@frgtn There are many errors right now that don't have error codes -- I'm not sure it would be feasible or desirable to give every error we emit today an error code. |
@jseyfried good point, thanks for your response. Is there some formal process that error messages are assigned codes or is it historically so that first errors have codes and the ones added later do not? This is a very minor issue and more of a nice-to-have for language integration into IDEs and editor plugins. I think it would be good if more common errors would eventually get assigned some sort of error codes (or the messages get standardised somehow) so that tools can identify them. |
I'm not aware of a formal process, it usually depends on whether the author thought it was worth it to add an error code.
Error codes are subject to change though, so checking the error code isn't much more stable than e.g. checking if Also, I'm not sure why you are expecting Why can't imports cannot be resolved with "as-you-type" checking? |
I'm going to give it a try. |
…, r=jseyfried File not found for module error Fixes #39542. r? @jonathandturner Maybe you want to take a look @pnkfelix?
"file not found for module" compile error does not have an error number/code, thus it cannot be easily identified/handled by external tools.
My use case is with Vim w0rp/ale plugin which does code checking as you type. It uses rustc to do "as-you-type" error checking and cargo check when a file is saved (see ale-integration-rust). Since imports cannot be resolved with "as-you-type" checking it would make sense to ignore such errors and only show them if they're detected by cargo. But since "file not found for module" doesn't have an error code I can't ignore it.
Example code
src/main.rs
:When compiling I expect to get an error with an error number, something like
error[E0123]: ...
but no error number is provided:The text was updated successfully, but these errors were encountered: