-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Parse macros named "default" correctly. #42330
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
t.is_keyword(keywords::Extern) || | ||
t.is_keyword(keywords::Type) || | ||
t.is_keyword(keywords::Pub)) | ||
} |
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.
Could you do something like this instead, to keep default
in the expected token set
fn eat_defaultness(&self) -> bool {
let is_defaultness = self.is_defaultness();
if is_defaultness {
self.bump();
} else {
self.expected_tokens.push(/*default keyword token*/);
}
is_defaultness
}
All this logic can probably be just inlined into parse_defaultness
as well.
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.
Done!
Thanks! |
📌 Commit b670930 has been approved by |
@bors rollup |
…chenkov Parse macros named "default" correctly. Fixes rust-lang#42292.
Fixes #42292.