Give better error for `macro_rules! name!` by aDotInTheVoid · Pull Request #8922...
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.
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 `!`")
self.struct_span_err(self.prev_token.span, "macro names arn't followed by a `!`")
.span_suggestion_verbose(
span,
"try removing this `!`",
// 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(
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.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK