]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_pretty/src/lib.rs
Actually infer args in visitors
[rust.git] / compiler / rustc_hir_pretty / src / lib.rs
index d11dca1cba47de1a01528caef1dbc3a2f27b81db..94dd2116e166bdb68bb17f2b5dc3d8d0c375a1b8 100644 (file)
@@ -103,6 +103,7 @@ pub fn print_node(&mut self, node: Node<'_>) {
             Node::TraitRef(a) => self.print_trait_ref(&a),
             Node::Binding(a) | Node::Pat(a) => self.print_pat(&a),
             Node::Arm(a) => self.print_arm(&a),
+            Node::Infer(_) => self.s.word("_"),
             Node::Block(a) => {
                 // Containing cbox, will be closed by print-block at `}`.
                 self.cbox(INDENT_UNIT);
@@ -437,14 +438,14 @@ pub fn print_type(&mut self, ty: &hir::Ty<'_>) {
                 self.print_anon_const(e);
                 self.s.word(")");
             }
-            hir::TyKind::Infer => {
-                self.s.word("_");
-            }
             hir::TyKind::Err => {
                 self.popen();
                 self.s.word("/*ERROR*/");
                 self.pclose();
             }
+            hir::TyKind::Infer => {
+                self.s.word("_");
+            }
         }
         self.end()
     }
@@ -1444,6 +1445,9 @@ enum AsmArg<'a> {
                 if opts.contains(ast::InlineAsmOptions::ATT_SYNTAX) {
                     options.push("att_syntax");
                 }
+                if opts.contains(ast::InlineAsmOptions::RAW) {
+                    options.push("raw");
+                }
                 s.commasep(Inconsistent, &options, |s, &opt| {
                     s.word(opt);
                 });
@@ -1536,7 +1540,6 @@ pub fn print_expr(&mut self, expr: &hir::Expr<'_>) {
                     self.word_space(":");
                 }
                 self.head("loop");
-                self.s.space();
                 self.print_block(&blk);
             }
             hir::ExprKind::Match(ref expr, arms, _) => {
@@ -1849,6 +1852,7 @@ fn print_generic_args(
                         GenericArg::Lifetime(_) => {}
                         GenericArg::Type(ty) => s.print_type(ty),
                         GenericArg::Const(ct) => s.print_anon_const(&ct.value),
+                        GenericArg::Infer(_inf) => s.word("_"),
                     },
                 );
             }