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

Keyword table in the language reference is not updated #17969

Closed
nodakai opened this issue Oct 12, 2014 · 1 comment · Fixed by #18375
Closed

Keyword table in the language reference is not updated #17969

nodakai opened this issue Oct 12, 2014 · 1 comment · Fixed by #18375

Comments

@nodakai
Copy link
Contributor

nodakai commented Oct 12, 2014

Compare

as
box break
continue crate
else enum extern
false fn for
if impl in
let loop
match mod mut
priv proc pub
ref return
self static struct super
trait true type
unsafe use
while

with

    pub mod keywords {
        // These ones are variants of the Keyword enum

        'strict:
        (12,                         As,         "as");
        (13,                         Break,      "break");
        (14,                         Crate,      "crate");
        (15,                         Else,       "else");
        (16,                         Enum,       "enum");
        (17,                         Extern,     "extern");
        (18,                         False,      "false");
        (19,                         Fn,         "fn");
        (20,                         For,        "for");
        (21,                         If,         "if");
        (22,                         Impl,       "impl");
        (23,                         In,         "in");
        (24,                         Let,        "let");
        (25,                         Loop,       "loop");
        (26,                         Match,      "match");
        (27,                         Mod,        "mod");
        (28,                         Move,       "move");
        (29,                         Mut,        "mut");
        (30,                         Once,       "once");
        (31,                         Pub,        "pub");
        (32,                         Ref,        "ref");
        (33,                         Return,     "return");
        // Static and Self are also special idents (prefill de-dupes)
        (super::STATIC_KEYWORD_NAME_NUM, Static, "static");
        (super::SELF_KEYWORD_NAME_NUM,   Self,   "self");
        (34,                         Struct,     "struct");
        (super::SUPER_KEYWORD_NAME_NUM, Super,   "super");
        (35,                         True,       "true");
        (36,                         Trait,      "trait");
        (37,                         Type,       "type");
        (38,                         Unsafe,     "unsafe");
        (39,                         Use,        "use");
        (40,                         Virtual,    "virtual");
        (41,                         While,      "while");
        (42,                         Continue,   "continue");
        (43,                         Proc,       "proc");
        (44,                         Box,        "box");
        (45,                         Const,      "const");
        (46,                         Where,      "where");

        'reserved:
        (47,                         Alignof,    "alignof");
        (48,                         Be,         "be");
        (49,                         Offsetof,   "offsetof");
        (50,                         Priv,       "priv");
        (51,                         Pure,       "pure");
        (52,                         Sizeof,     "sizeof");
        (53,                         Typeof,     "typeof");
        (54,                         Unsized,    "unsized");
        (55,                         Yield,      "yield");
        (56,                         Do,         "do");
        (57,                         Abstract,   "abstract");
        (58,                         Final,      "final");
        (59,                         Override,   "override");
    }

from https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/token.rs#L468

I'm not sure how to treat obsoleted but still "reserved" keywords such as do. (Maybe we can refer to Java's const ??)

@steveklabnik
Copy link
Member

I think it is good to have the reserved but not used keywords in the table, yeah.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Oct 28, 2014
dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
lnicola pushed a commit to lnicola/rust that referenced this issue Aug 29, 2024
fix: Fix name resolution of shadowed builtin macro

Fixes rust-lang#17969.
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 a pull request may close this issue.

3 participants