@@ -95,7 +95,7 @@ pub struct State<'a> {
9595 ann : & ' a ( dyn PpAnn + ' a ) ,
9696}
9797
98- crate const INDENT_UNIT : isize = 4 ;
98+ pub ( crate ) const INDENT_UNIT : isize = 4 ;
9999
100100/// Requires you to pass an input filename and reader so that
101101/// it can scan the input text for comments to copy forward.
@@ -955,8 +955,13 @@ impl<'a> State<'a> {
955955 State { s : pp:: Printer :: new ( ) , comments : None , ann : & NoAnn }
956956 }
957957
958- crate fn commasep_cmnt < T , F , G > ( & mut self , b : Breaks , elts : & [ T ] , mut op : F , mut get_span : G )
959- where
958+ pub ( crate ) fn commasep_cmnt < T , F , G > (
959+ & mut self ,
960+ b : Breaks ,
961+ elts : & [ T ] ,
962+ mut op : F ,
963+ mut get_span : G ,
964+ ) where
960965 F : FnMut ( & mut State < ' _ > , & T ) ,
961966 G : FnMut ( & T ) -> rustc_span:: Span ,
962967 {
@@ -976,7 +981,7 @@ impl<'a> State<'a> {
976981 self . end ( ) ;
977982 }
978983
979- crate fn commasep_exprs ( & mut self , b : Breaks , exprs : & [ P < ast:: Expr > ] ) {
984+ pub ( crate ) fn commasep_exprs ( & mut self , b : Breaks , exprs : & [ P < ast:: Expr > ] ) {
980985 self . commasep_cmnt ( b, exprs, |s, e| s. print_expr ( e) , |e| e. span )
981986 }
982987
@@ -1109,7 +1114,7 @@ impl<'a> State<'a> {
11091114 self . print_trait_ref ( & t. trait_ref )
11101115 }
11111116
1112- crate fn print_stmt ( & mut self , st : & ast:: Stmt ) {
1117+ pub ( crate ) fn print_stmt ( & mut self , st : & ast:: Stmt ) {
11131118 self . maybe_print_comment ( st. span . lo ( ) ) ;
11141119 match st. kind {
11151120 ast:: StmtKind :: Local ( ref loc) => {
@@ -1164,19 +1169,19 @@ impl<'a> State<'a> {
11641169 self . maybe_print_trailing_comment ( st. span , None )
11651170 }
11661171
1167- crate fn print_block ( & mut self , blk : & ast:: Block ) {
1172+ pub ( crate ) fn print_block ( & mut self , blk : & ast:: Block ) {
11681173 self . print_block_with_attrs ( blk, & [ ] )
11691174 }
11701175
1171- crate fn print_block_unclosed_indent ( & mut self , blk : & ast:: Block ) {
1176+ pub ( crate ) fn print_block_unclosed_indent ( & mut self , blk : & ast:: Block ) {
11721177 self . print_block_maybe_unclosed ( blk, & [ ] , false )
11731178 }
11741179
1175- crate fn print_block_with_attrs ( & mut self , blk : & ast:: Block , attrs : & [ ast:: Attribute ] ) {
1180+ pub ( crate ) fn print_block_with_attrs ( & mut self , blk : & ast:: Block , attrs : & [ ast:: Attribute ] ) {
11761181 self . print_block_maybe_unclosed ( blk, attrs, true )
11771182 }
11781183
1179- crate fn print_block_maybe_unclosed (
1184+ pub ( crate ) fn print_block_maybe_unclosed (
11801185 & mut self ,
11811186 blk : & ast:: Block ,
11821187 attrs : & [ ast:: Attribute ] ,
@@ -1210,7 +1215,7 @@ impl<'a> State<'a> {
12101215 }
12111216
12121217 /// Print a `let pat = expr` expression.
1213- crate fn print_let ( & mut self , pat : & ast:: Pat , expr : & ast:: Expr ) {
1218+ pub ( crate ) fn print_let ( & mut self , pat : & ast:: Pat , expr : & ast:: Expr ) {
12141219 self . word ( "let " ) ;
12151220 self . print_pat ( pat) ;
12161221 self . space ( ) ;
@@ -1219,7 +1224,7 @@ impl<'a> State<'a> {
12191224 self . print_expr_cond_paren ( expr, Self :: cond_needs_par ( expr) || npals ( ) )
12201225 }
12211226
1222- crate fn print_mac ( & mut self , m : & ast:: MacCall ) {
1227+ pub ( crate ) fn print_mac ( & mut self , m : & ast:: MacCall ) {
12231228 self . print_mac_common (
12241229 Some ( MacHeader :: Path ( & m. path ) ) ,
12251230 true ,
@@ -1360,15 +1365,15 @@ impl<'a> State<'a> {
13601365 self . pclose ( ) ;
13611366 }
13621367
1363- crate fn print_local_decl ( & mut self , loc : & ast:: Local ) {
1368+ pub ( crate ) fn print_local_decl ( & mut self , loc : & ast:: Local ) {
13641369 self . print_pat ( & loc. pat ) ;
13651370 if let Some ( ref ty) = loc. ty {
13661371 self . word_space ( ":" ) ;
13671372 self . print_type ( ty) ;
13681373 }
13691374 }
13701375
1371- crate fn print_name ( & mut self , name : Symbol ) {
1376+ pub ( crate ) fn print_name ( & mut self , name : Symbol ) {
13721377 self . word ( name. to_string ( ) ) ;
13731378 self . ann . post ( self , AnnNode :: Name ( & name) )
13741379 }
@@ -1392,7 +1397,7 @@ impl<'a> State<'a> {
13921397 }
13931398 }
13941399
1395- crate fn print_pat ( & mut self , pat : & ast:: Pat ) {
1400+ pub ( crate ) fn print_pat ( & mut self , pat : & ast:: Pat ) {
13961401 self . maybe_print_comment ( pat. span . lo ( ) ) ;
13971402 self . ann . pre ( self , AnnNode :: Pat ( pat) ) ;
13981403 /* Pat isn't normalized, but the beauty of it
@@ -1551,7 +1556,7 @@ impl<'a> State<'a> {
15511556 }
15521557 }
15531558
1554- crate fn print_asyncness ( & mut self , asyncness : ast:: Async ) {
1559+ pub ( crate ) fn print_asyncness ( & mut self , asyncness : ast:: Async ) {
15551560 if asyncness. is_async ( ) {
15561561 self . word_nbsp ( "async" ) ;
15571562 }
@@ -1584,11 +1589,11 @@ impl<'a> State<'a> {
15841589 }
15851590 }
15861591
1587- crate fn print_lifetime ( & mut self , lifetime : ast:: Lifetime ) {
1592+ pub ( crate ) fn print_lifetime ( & mut self , lifetime : ast:: Lifetime ) {
15881593 self . print_name ( lifetime. ident . name )
15891594 }
15901595
1591- crate fn print_lifetime_bounds (
1596+ pub ( crate ) fn print_lifetime_bounds (
15921597 & mut self ,
15931598 lifetime : ast:: Lifetime ,
15941599 bounds : & ast:: GenericBounds ,
@@ -1608,7 +1613,7 @@ impl<'a> State<'a> {
16081613 }
16091614 }
16101615
1611- crate fn print_generic_params ( & mut self , generic_params : & [ ast:: GenericParam ] ) {
1616+ pub ( crate ) fn print_generic_params ( & mut self , generic_params : & [ ast:: GenericParam ] ) {
16121617 if generic_params. is_empty ( ) {
16131618 return ;
16141619 }
@@ -1662,12 +1667,12 @@ impl<'a> State<'a> {
16621667 }
16631668 }
16641669
1665- crate fn print_mt ( & mut self , mt : & ast:: MutTy , print_const : bool ) {
1670+ pub ( crate ) fn print_mt ( & mut self , mt : & ast:: MutTy , print_const : bool ) {
16661671 self . print_mutability ( mt. mutbl , print_const) ;
16671672 self . print_type ( & mt. ty )
16681673 }
16691674
1670- crate fn print_param ( & mut self , input : & ast:: Param , is_closure : bool ) {
1675+ pub ( crate ) fn print_param ( & mut self , input : & ast:: Param , is_closure : bool ) {
16711676 self . ibox ( INDENT_UNIT ) ;
16721677
16731678 self . print_outer_attributes_inline ( & input. attrs ) ;
@@ -1695,7 +1700,7 @@ impl<'a> State<'a> {
16951700 self . end ( ) ;
16961701 }
16971702
1698- crate fn print_fn_ret_ty ( & mut self , fn_ret_ty : & ast:: FnRetTy ) {
1703+ pub ( crate ) fn print_fn_ret_ty ( & mut self , fn_ret_ty : & ast:: FnRetTy ) {
16991704 if let ast:: FnRetTy :: Ty ( ty) = fn_ret_ty {
17001705 self . space_if_not_bol ( ) ;
17011706 self . ibox ( INDENT_UNIT ) ;
@@ -1706,7 +1711,7 @@ impl<'a> State<'a> {
17061711 }
17071712 }
17081713
1709- crate fn print_ty_fn (
1714+ pub ( crate ) fn print_ty_fn (
17101715 & mut self ,
17111716 ext : ast:: Extern ,
17121717 unsafety : ast:: Unsafe ,
@@ -1730,7 +1735,7 @@ impl<'a> State<'a> {
17301735 self . end ( ) ;
17311736 }
17321737
1733- crate fn print_fn_header_info ( & mut self , header : ast:: FnHeader ) {
1738+ pub ( crate ) fn print_fn_header_info ( & mut self , header : ast:: FnHeader ) {
17341739 self . print_constness ( header. constness ) ;
17351740 self . print_asyncness ( header. asyncness ) ;
17361741 self . print_unsafety ( header. unsafety ) ;
@@ -1750,21 +1755,21 @@ impl<'a> State<'a> {
17501755 self . word ( "fn" )
17511756 }
17521757
1753- crate fn print_unsafety ( & mut self , s : ast:: Unsafe ) {
1758+ pub ( crate ) fn print_unsafety ( & mut self , s : ast:: Unsafe ) {
17541759 match s {
17551760 ast:: Unsafe :: No => { }
17561761 ast:: Unsafe :: Yes ( _) => self . word_nbsp ( "unsafe" ) ,
17571762 }
17581763 }
17591764
1760- crate fn print_constness ( & mut self , s : ast:: Const ) {
1765+ pub ( crate ) fn print_constness ( & mut self , s : ast:: Const ) {
17611766 match s {
17621767 ast:: Const :: No => { }
17631768 ast:: Const :: Yes ( _) => self . word_nbsp ( "const" ) ,
17641769 }
17651770 }
17661771
1767- crate fn print_is_auto ( & mut self , s : ast:: IsAuto ) {
1772+ pub ( crate ) fn print_is_auto ( & mut self , s : ast:: IsAuto ) {
17681773 match s {
17691774 ast:: IsAuto :: Yes => self . word_nbsp ( "auto" ) ,
17701775 ast:: IsAuto :: No => { }
0 commit comments