]> 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 5c1739b1ab9b63a02be65fa50170dd7baf04bebc..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()
     }
@@ -1851,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("_"),
                     },
                 );
             }