Skip to content
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

Merged
merged 1 commit into from May 27, 2019

Conversation

Projects
None yet
6 participants
@estebank
Copy link
Contributor

commented May 24, 2019

  • 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.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented May 24, 2019

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2019

@bors

This comment was marked as resolved.

Copy link
Contributor

commented May 25, 2019

☔️ The latest upstream changes (presumably #61150) made this pull request unmergeable. Please resolve the merge conflicts.

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

@estebank estebank force-pushed the estebank:attr-diagnostics branch from 2e85ec1 to 609ffa1 May 25, 2019

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

Thanks, @estebank! Looks good to me.
@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

📌 Commit 609ffa1 has been approved by michaelwoerister

Centril added a commit to Centril/rust that referenced this pull request May 27, 2019

Rollup merge of rust-lang#61140 - estebank:attr-diagnostics, r=michae…
…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.

@petrochenkov petrochenkov self-assigned this May 27, 2019

@@ -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);

This comment has been minimized.

Copy link
@petrochenkov

petrochenkov May 27, 2019

Contributor

AFAIK, "malformed" is usually used in context of biology, like "malformed foetus/limb".
"Ill-formed" is something not fitting into a language/grammar.

This comment has been minimized.

Copy link
@Centril

Centril May 27, 2019

Member

🤷‍♂ 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.

@petrochenkov petrochenkov removed their assignment May 27, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

⌛️ Testing commit 609ffa1 with merge e70d538...

bors added a commit that referenced this pull request May 27, 2019

Auto merge of #61140 - estebank:attr-diagnostics, r=michaelwoerister
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.
@bors

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: michaelwoerister
Pushing e70d538 to master...

@bors bors added the merged-by-bors label May 27, 2019

@bors bors merged commit 609ffa1 into rust-lang:master May 27, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.