Rename kw::Empty as sym::empty.#141376
Conversation
Because the empty string is not a keyword.
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs Some changes occurred in compiler/rustc_ast_lowering/src/format.rs cc @m-ou-se Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
@petrochenkov: you previously rejected this change (along with
Because of the work I've been doing in #137978, empty identifiers are never stored any more. (There's even an assertion in Also, we no longer rely on |
|
If I'm allowed to give an unsolicited comment, in my head I always map So |
|
imo: |
|
There are about twenty symbols where the value doesn't match the name. ( I just want |
|
I was thinking about #134253 (comment) in the background and did some experiments. The symbols that end up in AST/HIR identifiers, besides actual lexical identifiers are:
So we either need to consistently move some of this stuff to "special identifiers", or just avoid additional entities and put them into |
|
In any case r=me on the changes in this PR as well.
|
|
@bors r=petrochenkov |
…rochenkov Rename `kw::Empty` as `sym::empty`. Because the empty string is not a keyword. r? `@petrochenkov`
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136400 (Improve handling of rustdoc lints when used with raw doc fragments.) - rust-lang#140967 (Async drop poll shim for error dropee generates noop body) - rust-lang#141019 (Update std doctests for android) - rust-lang#141062 (Update IDEs to use rustfmt 2024, fix Zed settings) - rust-lang#141109 (discuss deadlocks in the std::io::pipe() example) - rust-lang#141126 (rustdoc JSON: Don't apply `#[repr]` privacy heuristics) - rust-lang#141376 (Rename `kw::Empty` as `sym::empty`.) - rust-lang#141383 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 7 pull requests Successful merges: - #136400 (Improve handling of rustdoc lints when used with raw doc fragments.) - #140967 (Async drop poll shim for error dropee generates noop body) - #141019 (Update std doctests for android) - #141109 (discuss deadlocks in the std::io::pipe() example) - #141126 (rustdoc JSON: Don't apply `#[repr]` privacy heuristics) - #141376 (Rename `kw::Empty` as `sym::empty`.) - #141383 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
…rochenkov Rename `kw::Empty` as `sym::empty`. Because the empty string is not a keyword. r? `@petrochenkov`
Because the empty string is not a keyword.
r? @petrochenkov