rust/compiler/rustc_parse/src
Nicholas Nethercote 1564318482 Only have one source of truth for keywords.
`rustc_symbol` is the source of truth for keywords.

rustdoc has its own implicit definition of keywords, via the
`is_doc_keyword`. It (presumably) intends to include all keywords, but
it omits `yeet`.

rustfmt has its own explicit list of Rust keywords. It also (presumably)
intends to include all keywords, but it omits `await`, `builtin`, `gen`,
`macro_rules`, `raw`, `reuse`, `safe`, and `yeet`. Also, it does linear
searches through this list, which is inefficient.

This commit fixes all of the above problems by introducing a new
predicate `is_any_keyword` in rustc and using it in rustdoc and rustfmt.
It documents that it's not the right predicate in most cases.
2024-12-18 20:21:03 +11:00
..
lexer Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
parser Only have one source of truth for keywords. 2024-12-18 20:21:03 +11:00
errors.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
lib.rs Add test to check unicode identifier version 2024-12-09 06:23:59 -08:00
validate_attr.rs Add hir::Attribute 2024-12-15 19:18:46 +01:00