Skip to content
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

chris-morgan
Copy link
Member

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.

// 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 {(
Copy link
Member

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.)

Copy link
Member Author

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.

Copy link
Member

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.

@chris-morgan
Copy link
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.
@bors bors closed this Dec 11, 2013
@bors bors merged commit dd042ef into rust-lang:master Dec 11, 2013
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.
@huonw huonw mentioned this pull request Jan 6, 2016
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants