-
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
Reword malformed attribute input diagnostics #61140
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
CC @rust-lang/wg-diagnostics @petrochenkov @Centril |
This comment has been minimized.
This comment has been minimized.
- Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser
2e85ec1
to
609ffa1
Compare
📌 Commit 609ffa1 has been approved by |
…lwoerister Reword malformed attribute input diagnostics - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser Split up from rust-lang#61026, where there's prior conversation.
@@ -1858,24 +1858,32 @@ impl<'a> PostExpansionVisitor<'a> { | |||
|
|||
match attr.parse_meta(self.context.parse_sess) { | |||
Ok(meta) => if !should_skip(name) && !template.compatible(&meta.node) { | |||
let error_msg = format!("malformed `{}` attribute input", name); |
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.
AFAIK, "malformed" is usually used in context of biology, like "malformed foetus/limb".
"Ill-formed" is something not fitting into a language/grammar.
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've heard malformed being used wrt. syntax as well; a google search does give plenty of results for "malformed syntax". I've also used "malformed" in the context of grammar myself before.
Reword malformed attribute input diagnostics - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser Split up from #61026, where there's prior conversation.
☀️ Test successful - checks-travis, status-appveyor |
cfg_attr
attributederive
attribute errorattrname
attribute input"Split up from #61026, where there's prior conversation.