about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-09-08 10:52:51 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-11-17 13:45:59 +1100
commit6b7ca2fcf2ebbba705f7a98c00bd56b5348ee9d7 (patch)
tree36212a72da44e033e4bae2d42d087abcf488748f /compiler/rustc_ast_pretty/src/pprust/state/expr.rs
parentbebd57a9602e48431c90274fbf7d96683b0708b6 (diff)
downloadrust-6b7ca2fcf2ebbba705f7a98c00bd56b5348ee9d7.tar.gz
rust-6b7ca2fcf2ebbba705f7a98c00bd56b5348ee9d7.zip
Box `ExprKind::{Closure,MethodCall}`, and `QSelf` in expressions, types, and patterns.
Diffstat (limited to 'compiler/rustc_ast_pretty/src/pprust/state/expr.rs')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/expr.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index 86f1d6bfecd..1da40d2302e 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -121,7 +121,7 @@ impl<'a> State<'a> {
 
     fn print_expr_struct(
         &mut self,
-        qself: &Option<ast::QSelf>,
+        qself: &Option<P<ast::QSelf>>,
         path: &ast::Path,
         fields: &[ast::ExprField],
         rest: &ast::StructRest,
@@ -307,8 +307,13 @@ impl<'a> State<'a> {
             ast::ExprKind::Call(ref func, ref args) => {
                 self.print_expr_call(func, &args);
             }
-            ast::ExprKind::MethodCall(ref segment, ref receiver, ref args, _) => {
-                self.print_expr_method_call(segment, &receiver, &args);
+            ast::ExprKind::MethodCall(box ast::MethodCall {
+                ref seg,
+                ref receiver,
+                ref args,
+                ..
+            }) => {
+                self.print_expr_method_call(seg, &receiver, &args);
             }
             ast::ExprKind::Binary(op, ref lhs, ref rhs) => {
                 self.print_expr_binary(op, lhs, rhs);
@@ -396,21 +401,21 @@ impl<'a> State<'a> {
                 let empty = attrs.is_empty() && arms.is_empty();
                 self.bclose(expr.span, empty);
             }
-            ast::ExprKind::Closure(
+            ast::ExprKind::Closure(box ast::Closure {
                 ref binder,
                 capture_clause,
                 asyncness,
                 movability,
-                ref decl,
+                ref fn_decl,
                 ref body,
-                _,
-            ) => {
+                fn_decl_span: _,
+            }) => {
                 self.print_closure_binder(binder);
                 self.print_movability(movability);
                 self.print_asyncness(asyncness);
                 self.print_capture_clause(capture_clause);
 
-                self.print_fn_params_and_ret(decl, true);
+                self.print_fn_params_and_ret(fn_decl, true);
                 self.space();
                 self.print_expr(body);
                 self.end(); // need to close a box