diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-01 16:46:08 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-16 13:41:34 +1000 |
| commit | 5d3cc1713a8816e3b4f10dc2cbaf910b16dc8763 (patch) | |
| tree | 77d1d426c31035de44e8f4622ee1308026ffa449 /compiler/rustc_builtin_macros/src | |
| parent | d7a041f6071a09bfcc5addcff4954985aef0bc31 (diff) | |
| download | rust-5d3cc1713a8816e3b4f10dc2cbaf910b16dc8763.tar.gz rust-5d3cc1713a8816e3b4f10dc2cbaf910b16dc8763.zip | |
Rename some things related to literals.
- Rename `ast::Lit::token` as `ast::Lit::token_lit`, because its type is
`token::Lit`, which is not a token. (This has been confusing me for a
long time.)
reasonable because we have an `ast::token::Lit` inside an `ast::Lit`.
- Rename `LitKind::{from,to}_lit_token` as
`LitKind::{from,to}_token_lit`, to match the above change and
`token::Lit`.
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/derive.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/src/derive.rs b/compiler/rustc_builtin_macros/src/derive.rs index d3de10ca4a2..467ac34ded9 100644 --- a/compiler/rustc_builtin_macros/src/derive.rs +++ b/compiler/rustc_builtin_macros/src/derive.rs @@ -126,9 +126,9 @@ fn report_bad_target(sess: &Session, item: &Annotatable, span: Span) -> bool { } fn report_unexpected_literal(sess: &Session, lit: &ast::Lit) { - let help_msg = match lit.token.kind { - token::Str if rustc_lexer::is_ident(lit.token.symbol.as_str()) => { - format!("try using `#[derive({})]`", lit.token.symbol) + let help_msg = match lit.token_lit.kind { + token::Str if rustc_lexer::is_ident(lit.token_lit.symbol.as_str()) => { + format!("try using `#[derive({})]`", lit.token_lit.symbol) } _ => "for example, write `#[derive(Debug)]` for `Debug`".to_string(), }; |
