@@ -196,7 +196,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
196196 if let Some ( label) = label {
197197 let label_bind = self . next ( "label" ) ;
198198
199- println ! ( " if let Some(ref {}) = {}" , label_bind, self . current) ;
199+ println ! ( " if let Some(ref {}) = {}; " , label_bind, self . current) ;
200200
201201 let label_name_bind = self . next ( "label_name" ) ;
202202 let label_name = label. ident . name ;
@@ -246,7 +246,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
246246 let str_pat = self . next ( "s" ) ;
247247
248248 println ! ( " if let LitKind::Str(ref {}, _) = {}.node;" , str_pat, lit_pat) ;
249- println ! ( " if {}.as_str() == {:?}" , str_pat, & * text. as_str( ) ) ;
249+ println ! ( " if {}.as_str() == {:?}; " , str_pat, & * text. as_str( ) ) ;
250250 } ,
251251 }
252252 }
@@ -311,7 +311,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
311311 let body_pat = self . next ( "body" ) ;
312312
313313 println ! (
314- " if let Some(higher::While {{ condition: {}, body: {} }}) = higher::While::hir({})" ,
314+ " if let Some(higher::While {{ condition: {}, body: {} }}) = higher::While::hir({}); " ,
315315 condition_pat, body_pat, self . current
316316 ) ;
317317
@@ -335,7 +335,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
335335 let if_then_pat = self . next ( "if_then" ) ;
336336
337337 println ! (
338- " if let Some(higher::WhileLet {{ let_pat: {}, let_expr: {}, if_then: {} }}) = higher::WhileLet::hir({})" ,
338+ " if let Some(higher::WhileLet {{ let_pat: {}, let_expr: {}, if_then: {} }}) = higher::WhileLet::hir({}); " ,
339339 let_pat_, let_expr_pat, if_then_pat, self . current
340340 ) ;
341341
@@ -364,7 +364,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
364364 let else_pat = self . next ( "else_expr" ) ;
365365
366366 println ! (
367- " if let Some(higher::IfLet {{ let_pat: {}, let_expr: {}, if_then: {}, if_else: {}}}) = higher::IfLet::hir({})" ,
367+ " if let Some(higher::IfLet {{ let_pat: {}, let_expr: {}, if_then: {}, if_else: {}}}) = higher::IfLet::hir({}); " ,
368368 let_pat_, let_expr_pat, if_then_pat, else_pat, self . current
369369 ) ;
370370
@@ -391,7 +391,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
391391 let else_pat = self . next ( "else_expr" ) ;
392392
393393 println ! (
394- " if let Some(higher::If {{ cond: {}, then: {}, r#else: {}}}) = higher::If::hir({})" ,
394+ " if let Some(higher::If {{ cond: {}, then: {}, r#else: {}}}) = higher::If::hir({}); " ,
395395 cond_pat, then_pat, else_pat, self . current
396396 ) ;
397397
@@ -415,7 +415,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
415415 let body_pat = self . next ( "body" ) ;
416416
417417 println ! (
418- " if let Some(higher::ForLoop {{ pat: {}, arg: {}, body: {}, ..}}) = higher::ForLoop::hir({})" ,
418+ " if let Some(higher::ForLoop {{ pat: {}, arg: {}, body: {}, ..}}) = higher::ForLoop::hir({}); " ,
419419 pat_, arg_pat, body_pat, self . current
420420 ) ;
421421
@@ -596,7 +596,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
596596 let label_pat = self . next ( "label" ) ;
597597
598598 println ! (
599- "Loop(ref {}, ref {}, LoopSource::{:?}) = {};" ,
599+ "Loop(ref {}, ref {}, LoopSource::{:?}, _ ) = {};" ,
600600 body_pat, label_pat, des, current
601601 ) ;
602602
@@ -626,10 +626,10 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
626626 let body_id_pat = self . next ( "body_id" ) ;
627627
628628 println ! (
629- "Closure({}, ref {}, ref {}, _, {}) = {}" ,
629+ "Closure({}, ref {}, ref {}, _, {}) = {}; " ,
630630 capture_by, fn_decl_pat, body_id_pat, movability, current
631631 ) ;
632- println ! ( " if let {} = {}.output" , ret_ty, fn_decl_pat) ;
632+ println ! ( " if let {} = {}.output; " , ret_ty, fn_decl_pat) ;
633633
634634 let hir = self . cx . tcx . hir ( ) ;
635635 let body = hir. body ( body_id) ;
@@ -699,7 +699,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
699699 let field_name_pat = self . next ( "field_name" ) ;
700700
701701 println ! ( "Field(ref {}, ref {}) = {};" , obj_pat, field_name_pat, current) ;
702- println ! ( " if {}.as_str() == {:?}" , field_name_pat, field_ident. as_str( ) ) ;
702+ println ! ( " if {}.as_str() == {:?}; " , field_name_pat, field_ident. as_str( ) ) ;
703703
704704 self . current = obj_pat;
705705 self . visit_expr ( object) ;
@@ -804,13 +804,13 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
804804
805805 for ( i, field) in fields. iter ( ) . enumerate ( ) {
806806 println ! (
807- " if {}[{}].ident.name.as_str() == {:?}" ,
807+ " if {}[{}].ident.name.as_str() == {:?}; " ,
808808 fields_pat,
809809 i,
810810 & * field. ident. name. as_str( )
811811 ) ;
812812
813- self . current = format ! ( "{}[{}]" , fields_pat, i) ;
813+ self . current = format ! ( "{}[{}].expr " , fields_pat, i) ;
814814 self . visit_expr ( field. expr ) ;
815815 }
816816 } ,
@@ -909,7 +909,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
909909
910910 for ( i, field) in fields. iter ( ) . enumerate ( ) {
911911 println ! (
912- " if {}[{}].ident.name.as_str() == {:?}" ,
912+ " if {}[{}].ident.name.as_str() == {:?}; " ,
913913 fields_pat,
914914 i,
915915 & * field. ident. name. as_str( )
@@ -981,7 +981,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
981981 } ,
982982 PatKind :: Lit ( lit_expr) => {
983983 let lit_expr_pat = self . next ( "lit_expr" ) ;
984- println ! ( "Lit(ref {}) = {}" , lit_expr_pat, current) ;
984+ println ! ( "Lit(ref {}) = {}; " , lit_expr_pat, current) ;
985985
986986 self . current = lit_expr_pat;
987987 self . visit_expr ( lit_expr) ;
@@ -1063,7 +1063,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
10631063 // Expr without trailing semi-colon (must have unit type):
10641064 StmtKind :: Expr ( e) => {
10651065 let e_pat = self . next ( "e" ) ;
1066- println ! ( "Expr(ref {}, _) = {}" , e_pat, current) ;
1066+ println ! ( "Expr(ref {}, _) = {}; " , e_pat, current) ;
10671067
10681068 self . current = e_pat;
10691069 self . visit_expr ( e) ;
@@ -1072,7 +1072,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrintVisitor<'a, '_> {
10721072 // Expr with trailing semi-colon (may have any type):
10731073 StmtKind :: Semi ( e) => {
10741074 let e_pat = self . next ( "e" ) ;
1075- println ! ( "Semi(ref {}, _ ) = {}" , e_pat, current) ;
1075+ println ! ( "Semi(ref {}) = {}; " , e_pat, current) ;
10761076
10771077 self . current = e_pat;
10781078 self . visit_expr ( e) ;
0 commit comments