diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-11-29 13:01:04 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-12-02 10:23:44 +1100 |
| commit | e658144586e0fe4f77a7dadf7c80185fd0b71279 (patch) | |
| tree | f9a81b8ffbd8b03117b29893542368c0274b2d5e /compiler/rustc_ast/src/attr | |
| parent | c090c6880c0183ba248bde4a16e29ba29ac4fbba (diff) | |
| download | rust-e658144586e0fe4f77a7dadf7c80185fd0b71279.tar.gz rust-e658144586e0fe4f77a7dadf7c80185fd0b71279.zip | |
Rename `LitKind::to_token_lit` as `LitKind::synthesize_token_lit`.
This makes it clearer that it's not a lossless conversion, which I find helpful.
Diffstat (limited to 'compiler/rustc_ast/src/attr')
| -rw-r--r-- | compiler/rustc_ast/src/attr/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 057cc26b579..1ba46914675 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -328,7 +328,7 @@ pub fn mk_name_value_item_str(ident: Ident, str: Symbol, str_span: Span) -> Meta } pub fn mk_name_value_item(ident: Ident, kind: LitKind, lit_span: Span) -> MetaItem { - let lit = MetaItemLit { token_lit: kind.to_token_lit(), kind, span: lit_span }; + let lit = MetaItemLit { token_lit: kind.synthesize_token_lit(), kind, span: lit_span }; let span = ident.span.to(lit_span); MetaItem { path: Path::from_ident(ident), kind: MetaItemKind::NameValue(lit), span } } @@ -408,7 +408,7 @@ pub fn mk_attr_name_value_str( val: Symbol, span: Span, ) -> Attribute { - let lit = LitKind::Str(val, StrStyle::Cooked).to_token_lit(); + let lit = LitKind::Str(val, StrStyle::Cooked).synthesize_token_lit(); let expr = P(Expr { id: DUMMY_NODE_ID, kind: ExprKind::Lit(lit), |
