]> git.lizzy.rs Git - rust.git/commit
Remove `token::Lit` from `ast::MetaItemLit`.
authorNicholas Nethercote <n.nethercote@gmail.com>
Tue, 29 Nov 2022 02:36:00 +0000 (13:36 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Fri, 2 Dec 2022 02:49:19 +0000 (13:49 +1100)
commit2fd364acff5f962b0ce4f4dffb5ae085d5f2b67a
tree041c2e45d4449c44f874c737a3dcdbcaa8895c9f
parenta7f35c42d474f893c56b6e0f7df3f8bb965f2650
Remove `token::Lit` from `ast::MetaItemLit`.

`token::Lit` contains a `kind` field that indicates what kind of literal
it is. `ast::MetaItemLit` currently wraps a `token::Lit` but also has
its own `kind` field. This means that `ast::MetaItemLit` encodes the
literal kind in two different ways.

This commit changes `ast::MetaItemLit` so it no longer wraps
`token::Lit`. It now contains the `symbol` and `suffix` fields from
`token::Lit`, but not the `kind` field, eliminating the redundancy.
compiler/rustc_ast/src/ast.rs
compiler/rustc_ast/src/attr/mod.rs
compiler/rustc_ast/src/util/literal.rs
compiler/rustc_ast_lowering/src/lib.rs
compiler/rustc_ast_pretty/src/pprust/state.rs
compiler/rustc_builtin_macros/src/derive.rs
compiler/rustc_parse/src/parser/expr.rs
compiler/rustc_parse/src/parser/pat.rs
src/tools/rustfmt/src/attr.rs