about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-16 23:03:14 +0000
committerbors <bors@rust-lang.org>2022-11-16 23:03:14 +0000
commitbebd57a9602e48431c90274fbf7d96683b0708b6 (patch)
treee9d0c9731ffc16ca0a92dd34d5925f1fe05000e7 /compiler/rustc_ast_pretty/src/pprust/state/expr.rs
parente9493d63c2a57b91556dccd219e21821432c7445 (diff)
parent358a603f110b0489d22f3929d3f232e684fd9ffb (diff)
downloadrust-bebd57a9602e48431c90274fbf7d96683b0708b6.tar.gz
rust-bebd57a9602e48431c90274fbf7d96683b0708b6.zip
Auto merge of #102944 - nnethercote:ast-Lit-third-time-lucky, r=petrochenkov
Use `token::Lit` in `ast::ExprKind::Lit`.

Instead of `ast::Lit`.

Literal lowering now happens at two different times. Expression literals are lowered when HIR is crated. Attribute literals are lowered during parsing.

r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_ast_pretty/src/pprust/state/expr.rs')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/expr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index 930276242c3..86f1d6bfecd 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -319,8 +319,8 @@ impl<'a> State<'a> {
             ast::ExprKind::AddrOf(k, m, ref expr) => {
                 self.print_expr_addr_of(k, m, expr);
             }
-            ast::ExprKind::Lit(ref lit) => {
-                self.print_literal(lit);
+            ast::ExprKind::Lit(token_lit) => {
+                self.print_token_literal(token_lit, expr.span);
             }
             ast::ExprKind::IncludedBytes(ref bytes) => {
                 let lit = ast::Lit::from_included_bytes(bytes, expr.span);