-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Deduplicate in syntax::parse::token with a macro and remove obsolete special identifiers #10891
Conversation
// except starting from the next number instead of zero, and with the additional exception that | ||
// special identifiers are *also* allowed (they are deduplicated in the important place, the | ||
// interner), an exception which is demonstrated by "static" and "self". | ||
macro_rules! make_some_things {( |
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 this have a better name? (The lang items one was ok, since the module was devoted solely to lang items, but this one does more than just special idents/keywords.)
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.
Any suggestions? The macro name is quite irrelevant seeing as it's just sugar for the single invocation, but I agree that a proper name is more desirable.
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.
There's always the humdrum declare_keywords_and_special_idents
.
OK, I've given it a meaningful name now. r? |
I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order).
- underscore ("_") - unary ("unary") - not_fn ("!") - idx_fn ("[]") - unary_minus_fn ("unary-") - item ("item") - block ("block") - stmt ("stmt") - pat ("pat") - expr ("expr") - ty ("ty") - ident ("ident") - path ("path") - descrim ("descrim") - clownshoe_stack_shim ("__rust_stack_shim") - blk ("blk") - c_abi ("C") (And, of course, renumber everything to match.)
It's twenty lines longer, but makes for clearer separation of strict and reserved keywords (probably a good thing) and removes another moving part (the definitions of `(STRICT|RESERVED)_KEYWORD_(START|FINAL)`).
…macroify)-syntax--parse--token-so-that-we-don't-make-mistakes-and-to-reduce-the-maintenance-burden, r=huonw I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order). Unused special identifiers are also removed in the second part.
The fundamental problem of duplication was fixed in rust-lang#10891, but the comment was preserved. Closes rust-lang#9762.
The fundamental problem of duplication was fixed in rust-lang#10891, but the comment was preserved. Closes rust-lang#9762.
[`missing_const_for_fn`]: Ensure dropped locals are `~const Destruct` this will check every local for `TerminatorKind::Drop` to ensure they can be evaluated at compile time, not sure if this is the best way to do this but MIR is confusing and it works so... fixes rust-lang#10617 changelog: [`missing_const_for_fn`]: Ensure dropped locals are `~const Destruct`
I also renumbered things at the same time;
in
was shifted into itsalphabetical position and the reserved keywords were reordered (a couple
of them were out of order).
Unused special identifiers are also removed in the second part.