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

Give better error for macro_rules! name! #89221

Merged
merged 1 commit into from
Sep 25, 2021

Conversation

aDotInTheVoid
Copy link
Member

@aDotInTheVoid aDotInTheVoid commented Sep 24, 2021

r? @estebank

@rustbot modify labels: +A-diagnostics +A-parser

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2021
@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST. labels Sep 24, 2021
Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll have to rebless after addressing the review comments, but after that r=me

if self.eat(&token::Not) {
// Handle macro_rules! foo!
let span = self.prev_token.span;
self.struct_span_err(self.prev_token.span, "macro names arn't followed by a `!`")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.struct_span_err(self.prev_token.span, "macro names arn't followed by a `!`")
self.struct_span_err(span, "macro names aren't followed by a `!`")

self.struct_span_err(self.prev_token.span, "macro names arn't followed by a `!`")
.span_suggestion_verbose(
span,
"try removing this `!`",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"try removing this `!`",
"removing the `!`",

// Handle macro_rules! foo!
let span = self.prev_token.span;
self.struct_span_err(self.prev_token.span, "macro names arn't followed by a `!`")
.span_suggestion_verbose(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is ok to be inline: we're asking them to remove the whole thing in that is underlined, it should be fine.

Suggested change
.span_suggestion_verbose(
.span_suggestion(

@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 24, 2021

📌 Commit ed3b751 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 24, 2021
…bank

Give better error for `macro_rules! name!`

r? `@estebank`

`@rustbot` modify labels: +A-diagnostics +A-parser
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 25, 2021
…ingjubilee

Rollup of 8 pull requests

Successful merges:

 - rust-lang#88893 (Add 1.56.0 release notes)
 - rust-lang#89001 (Be explicit about using Binder::dummy)
 - rust-lang#89072 (Avoid a couple of Symbol::as_str calls in cg_llvm )
 - rust-lang#89104 (Simplify scoped_thread)
 - rust-lang#89208 ([rfc 2229] Drop fully captured upvars in the same order as the regular drop code)
 - rust-lang#89210 (Add missing time complexities to linked_list.rs)
 - rust-lang#89217 (Enable "generate-link-to-definition" option on rust tools docs as well)
 - rust-lang#89221 (Give better error for `macro_rules! name!`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6f31fa5 into rust-lang:master Sep 25, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 25, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 22, 2021
…bank

Give better error for `macro_rules name`

follow up to rust-lang#89221

r? `@estebank`

`@rustbot` modify labels: +A-diagnostics +A-parser
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 22, 2021
…bank

Give better error for `macro_rules name`

follow up to rust-lang#89221

r? ``@estebank``

``@rustbot`` modify labels: +A-diagnostics +A-parser
@aDotInTheVoid aDotInTheVoid deleted the macro-error-1 branch June 13, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants