-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Syntax codes #34637
Syntax codes #34637
Conversation
@@ -16,31 +16,374 @@ | |||
register_long_diagnostics! { | |||
|
|||
E0533: r##" | |||
The export_name attribute was badly formatted. |
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.
s/badly formatted/malformed/
@nagisa: I think I applied all your remarks. |
304f038
to
5eb689d
Compare
@@ -16,31 +16,394 @@ | |||
register_long_diagnostics! { | |||
|
|||
E0533: r##" | |||
The export_name attribute was malformed. |
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.
Shouldn’t you put things like export_name inside inline code element (i.e. between backticks)?
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.
I wondered about it. I decidec to change it if someone else thought the same so I will.
pub fn something() {} | ||
``` | ||
|
||
The "issue" named attribute parameter expects a github issue number. Example: |
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.
Ditto here.
I’m not sure describing error codes for rustc internal features (the stability things, mostly) has any meaningful purpose when considering the wider audience. |
It's always appreciated to have information right away instead of looking further. For people like me who don't work that much on internals, it's very helpful (but maybe am I the only one in this case?). |
5eb689d
to
65e933b
Compare
@nagisa: Thanks for all these typos! I added backticks around keywords as well. |
@@ -1,4 +1,4 @@ | |||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | |||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT |
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.
Should the copyright year be updated here? Should it be saying 2016 and not 2014-2016? Is the convention for this recorded anywhere?
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.
The point of error code explanations, even for the simplest errors, is to go faster. This PR fulfills this purpose. For example, if you forgot how to write a stabitility attribute or forgot a named attribute in it, you'll just have to look at the error explanation instead of looking into the code. |
I think I actually need a better explanation @nagisa about your last comment. @jonathandturner and I didn't understand your message the same way. |
65e933b
to
6961921
Compare
On IRC:
|
6961921
to
b777f14
Compare
@bors: r+ |
📌 Commit b777f14 has been approved by |
Syntax codes r? @jonathandturner cc @steveklabnik This is a first big shot. I'll do the second one later in the week once this one is merged.
r? @jonathandturner
cc @steveklabnik
This is a first big shot. I'll do the second one later in the week once this one is merged.