diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-12-13 21:07:58 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-12-18 20:21:03 +1100 |
| commit | 1564318482e80152d43150fdfc3ade2c868f2677 (patch) | |
| tree | 77d53bdb39cd2de362ffe88281af4bdbda27acc5 /compiler/rustc_codegen_gcc/example/alloc_example.rs | |
| parent | 64abe8be33326643bcc32e25e4c6aaf3555e145b (diff) | |
| download | rust-1564318482e80152d43150fdfc3ade2c868f2677.tar.gz rust-1564318482e80152d43150fdfc3ade2c868f2677.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_example.rs')
0 files changed, 0 insertions, 0 deletions
