Deduplicate in syntax::parse::token with a macro and remove obsolete special identifiers#10891
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.)
Member
Author
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
There's always the humdrum declare_keywords_and_special_idents.
Member
Author
|
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)`).
bors
added a commit
that referenced
this pull request
Dec 11, 2013
…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.
huonw
added a commit
to huonw/rust
that referenced
this pull request
Jan 6, 2016
The fundamental problem of duplication was fixed in rust-lang#10891, but the comment was preserved. Closes rust-lang#9762.
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this pull request
Jan 6, 2016
The fundamental problem of duplication was fixed in rust-lang#10891, but the comment was preserved. Closes rust-lang#9762.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jun 30, 2023
[`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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I also renumbered things at the same time;
inwas 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.