5

Give better error for `macro_rules! name!` by aDotInTheVoid · Pull Request #8922...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/89221
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

@estebank estebank 16 days ago

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

@estebank estebank 16 days ago

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

@estebank estebank 16 days ago

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(

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK