-
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
Add a distinct error code and description for "main function has wrong type" #37242
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -1424,6 +1424,14 @@ error. To resolve it, add an `else` block having the same type as the `if` | |||
block. | |||
"##, | |||
|
|||
E0318: r##" | |||
The `main` function is required to have the signature `fn main() { ... }`, with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't need the { ... }
in the signature
You'll need to use a fresh error code, rather than one that is already in use. r=me with that and the nit above addressed. |
Just waiting on updates from @jfirebaugh. Error code 318 seems to be already allocated. You'll need to define a new one in librustc/diagnostics.rs. |
☔ The latest upstream changes (presumably #37678) made this pull request unmergeable. Please resolve the merge conflicts. |
For info, the actual biggest error code is E0570. |
e485c88
to
6bb4b84
Compare
I thought I had picked a unique one but I guess somehow I didn't search the whole tree. Switch to E0330. |
This is still the same issue: the E0330 exist**ed**. |
No, it's not the same issue. |
Then I don't understand... Like said, E0330 exist**ed** so you can't use it. Now please explain what I got wrong. :-/ |
@GuillaumeGomez Sorry for my tone, I was in a grouchy mood and should have waited to comment. The CI failure this time was due to a test case that had not been updated to the new error code. I don't see any indications in the repository history that E0330 has ever been used. Am I missing something?
|
For some history reason, we don't reuse an error code. Then if it's lower than the actual highest error code I gave in a previous comment, then it has been used and shouldn't be reused. So even if you can't find it in the git logs, don't bother and create a new one higher than the actual highest one. |
ping @jfirebaugh , are you still interested in updating this PR? |
No. |
Followup to #36915. Adds a distinct error code and description for the "main function has wrong type" variant of E0308.