@@ -43,8 +43,7 @@ pub trait PpAnn {
4343 fn post ( & self , _state : & mut State < ' _ > , _node : AnnNode < ' _ > ) { }
4444}
4545
46- #[ derive( Copy , Clone ) ]
47- pub struct NoAnn ;
46+ struct NoAnn ;
4847
4948impl PpAnn for NoAnn { }
5049
@@ -61,11 +60,11 @@ impl<'a> Comments<'a> {
6160 }
6261
6362 // FIXME: This shouldn't probably clone lmao
64- pub fn next ( & self ) -> Option < Comment > {
63+ fn next ( & self ) -> Option < Comment > {
6564 self . comments . get ( self . current ) . cloned ( )
6665 }
6766
68- pub fn trailing_comment (
67+ fn trailing_comment (
6968 & self ,
7069 span : rustc_span:: Span ,
7170 next_pos : Option < BytePos > ,
@@ -92,7 +91,7 @@ pub struct State<'a> {
9291 ann : & ' a ( dyn PpAnn + ' a ) ,
9392}
9493
95- pub ( crate ) const INDENT_UNIT : isize = 4 ;
94+ const INDENT_UNIT : isize = 4 ;
9695
9796/// Requires you to pass an input filename and reader so that
9897/// it can scan the input text for comments to copy forward.
@@ -217,7 +216,7 @@ fn doc_comment_to_string(
217216 }
218217}
219218
220- pub fn literal_to_string ( lit : token:: Lit ) -> String {
219+ fn literal_to_string ( lit : token:: Lit ) -> String {
221220 let token:: Lit { kind, symbol, suffix } = lit;
222221 let mut out = match kind {
223222 token:: Byte => format ! ( "b'{symbol}'" ) ,
@@ -976,13 +975,8 @@ impl<'a> State<'a> {
976975 State { s : pp:: Printer :: new ( ) , comments : None , ann : & NoAnn }
977976 }
978977
979- pub ( crate ) fn commasep_cmnt < T , F , G > (
980- & mut self ,
981- b : Breaks ,
982- elts : & [ T ] ,
983- mut op : F ,
984- mut get_span : G ,
985- ) where
978+ fn commasep_cmnt < T , F , G > ( & mut self , b : Breaks , elts : & [ T ] , mut op : F , mut get_span : G )
979+ where
986980 F : FnMut ( & mut State < ' _ > , & T ) ,
987981 G : FnMut ( & T ) -> rustc_span:: Span ,
988982 {
@@ -1002,7 +996,7 @@ impl<'a> State<'a> {
1002996 self . end ( ) ;
1003997 }
1004998
1005- pub ( crate ) fn commasep_exprs ( & mut self , b : Breaks , exprs : & [ P < ast:: Expr > ] ) {
999+ fn commasep_exprs ( & mut self , b : Breaks , exprs : & [ P < ast:: Expr > ] ) {
10061000 self . commasep_cmnt ( b, exprs, |s, e| s. print_expr ( e) , |e| e. span )
10071001 }
10081002
@@ -1153,7 +1147,7 @@ impl<'a> State<'a> {
11531147 self . print_trait_ref ( & t. trait_ref )
11541148 }
11551149
1156- pub ( crate ) fn print_stmt ( & mut self , st : & ast:: Stmt ) {
1150+ fn print_stmt ( & mut self , st : & ast:: Stmt ) {
11571151 self . maybe_print_comment ( st. span . lo ( ) ) ;
11581152 match & st. kind {
11591153 ast:: StmtKind :: Local ( loc) => {
@@ -1208,19 +1202,19 @@ impl<'a> State<'a> {
12081202 self . maybe_print_trailing_comment ( st. span , None )
12091203 }
12101204
1211- pub ( crate ) fn print_block ( & mut self , blk : & ast:: Block ) {
1205+ fn print_block ( & mut self , blk : & ast:: Block ) {
12121206 self . print_block_with_attrs ( blk, & [ ] )
12131207 }
12141208
1215- pub ( crate ) fn print_block_unclosed_indent ( & mut self , blk : & ast:: Block ) {
1209+ fn print_block_unclosed_indent ( & mut self , blk : & ast:: Block ) {
12161210 self . print_block_maybe_unclosed ( blk, & [ ] , false )
12171211 }
12181212
1219- pub ( crate ) fn print_block_with_attrs ( & mut self , blk : & ast:: Block , attrs : & [ ast:: Attribute ] ) {
1213+ fn print_block_with_attrs ( & mut self , blk : & ast:: Block , attrs : & [ ast:: Attribute ] ) {
12201214 self . print_block_maybe_unclosed ( blk, attrs, true )
12211215 }
12221216
1223- pub ( crate ) fn print_block_maybe_unclosed (
1217+ fn print_block_maybe_unclosed (
12241218 & mut self ,
12251219 blk : & ast:: Block ,
12261220 attrs : & [ ast:: Attribute ] ,
@@ -1254,7 +1248,7 @@ impl<'a> State<'a> {
12541248 }
12551249
12561250 /// Print a `let pat = expr` expression.
1257- pub ( crate ) fn print_let ( & mut self , pat : & ast:: Pat , expr : & ast:: Expr ) {
1251+ fn print_let ( & mut self , pat : & ast:: Pat , expr : & ast:: Expr ) {
12581252 self . word ( "let " ) ;
12591253 self . print_pat ( pat) ;
12601254 self . space ( ) ;
@@ -1263,7 +1257,7 @@ impl<'a> State<'a> {
12631257 self . print_expr_cond_paren ( expr, Self :: cond_needs_par ( expr) || npals ( ) )
12641258 }
12651259
1266- pub ( crate ) fn print_mac ( & mut self , m : & ast:: MacCall ) {
1260+ fn print_mac ( & mut self , m : & ast:: MacCall ) {
12671261 self . print_mac_common (
12681262 Some ( MacHeader :: Path ( & m. path ) ) ,
12691263 true ,
@@ -1404,15 +1398,15 @@ impl<'a> State<'a> {
14041398 self . pclose ( ) ;
14051399 }
14061400
1407- pub ( crate ) fn print_local_decl ( & mut self , loc : & ast:: Local ) {
1401+ fn print_local_decl ( & mut self , loc : & ast:: Local ) {
14081402 self . print_pat ( & loc. pat ) ;
14091403 if let Some ( ty) = & loc. ty {
14101404 self . word_space ( ":" ) ;
14111405 self . print_type ( ty) ;
14121406 }
14131407 }
14141408
1415- pub ( crate ) fn print_name ( & mut self , name : Symbol ) {
1409+ fn print_name ( & mut self , name : Symbol ) {
14161410 self . word ( name. to_string ( ) ) ;
14171411 self . ann . post ( self , AnnNode :: Name ( & name) )
14181412 }
@@ -1436,7 +1430,7 @@ impl<'a> State<'a> {
14361430 }
14371431 }
14381432
1439- pub ( crate ) fn print_pat ( & mut self , pat : & ast:: Pat ) {
1433+ fn print_pat ( & mut self , pat : & ast:: Pat ) {
14401434 self . maybe_print_comment ( pat. span . lo ( ) ) ;
14411435 self . ann . pre ( self , AnnNode :: Pat ( pat) ) ;
14421436 /* Pat isn't normalized, but the beauty of it
@@ -1589,7 +1583,7 @@ impl<'a> State<'a> {
15891583 }
15901584 }
15911585
1592- pub ( crate ) fn print_asyncness ( & mut self , asyncness : ast:: Async ) {
1586+ fn print_asyncness ( & mut self , asyncness : ast:: Async ) {
15931587 if asyncness. is_async ( ) {
15941588 self . word_nbsp ( "async" ) ;
15951589 }
@@ -1634,11 +1628,11 @@ impl<'a> State<'a> {
16341628 }
16351629 }
16361630
1637- pub ( crate ) fn print_lifetime ( & mut self , lifetime : ast:: Lifetime ) {
1631+ fn print_lifetime ( & mut self , lifetime : ast:: Lifetime ) {
16381632 self . print_name ( lifetime. ident . name )
16391633 }
16401634
1641- pub ( crate ) fn print_lifetime_bounds ( & mut self , bounds : & ast:: GenericBounds ) {
1635+ fn print_lifetime_bounds ( & mut self , bounds : & ast:: GenericBounds ) {
16421636 for ( i, bound) in bounds. iter ( ) . enumerate ( ) {
16431637 if i != 0 {
16441638 self . word ( " + " ) ;
@@ -1650,7 +1644,7 @@ impl<'a> State<'a> {
16501644 }
16511645 }
16521646
1653- pub ( crate ) fn print_generic_params ( & mut self , generic_params : & [ ast:: GenericParam ] ) {
1647+ fn print_generic_params ( & mut self , generic_params : & [ ast:: GenericParam ] ) {
16541648 if generic_params. is_empty ( ) {
16551649 return ;
16561650 }
@@ -1714,12 +1708,12 @@ impl<'a> State<'a> {
17141708 }
17151709 }
17161710
1717- pub ( crate ) fn print_mt ( & mut self , mt : & ast:: MutTy , print_const : bool ) {
1711+ fn print_mt ( & mut self , mt : & ast:: MutTy , print_const : bool ) {
17181712 self . print_mutability ( mt. mutbl , print_const) ;
17191713 self . print_type ( & mt. ty )
17201714 }
17211715
1722- pub ( crate ) fn print_param ( & mut self , input : & ast:: Param , is_closure : bool ) {
1716+ fn print_param ( & mut self , input : & ast:: Param , is_closure : bool ) {
17231717 self . ibox ( INDENT_UNIT ) ;
17241718
17251719 self . print_outer_attributes_inline ( & input. attrs ) ;
@@ -1747,7 +1741,7 @@ impl<'a> State<'a> {
17471741 self . end ( ) ;
17481742 }
17491743
1750- pub ( crate ) fn print_fn_ret_ty ( & mut self , fn_ret_ty : & ast:: FnRetTy ) {
1744+ fn print_fn_ret_ty ( & mut self , fn_ret_ty : & ast:: FnRetTy ) {
17511745 if let ast:: FnRetTy :: Ty ( ty) = fn_ret_ty {
17521746 self . space_if_not_bol ( ) ;
17531747 self . ibox ( INDENT_UNIT ) ;
@@ -1758,7 +1752,7 @@ impl<'a> State<'a> {
17581752 }
17591753 }
17601754
1761- pub ( crate ) fn print_ty_fn (
1755+ fn print_ty_fn (
17621756 & mut self ,
17631757 ext : ast:: Extern ,
17641758 unsafety : ast:: Unsafe ,
@@ -1782,7 +1776,7 @@ impl<'a> State<'a> {
17821776 self . end ( ) ;
17831777 }
17841778
1785- pub ( crate ) fn print_fn_header_info ( & mut self , header : ast:: FnHeader ) {
1779+ fn print_fn_header_info ( & mut self , header : ast:: FnHeader ) {
17861780 self . print_constness ( header. constness ) ;
17871781 self . print_asyncness ( header. asyncness ) ;
17881782 self . print_unsafety ( header. unsafety ) ;
@@ -1802,21 +1796,21 @@ impl<'a> State<'a> {
18021796 self . word ( "fn" )
18031797 }
18041798
1805- pub ( crate ) fn print_unsafety ( & mut self , s : ast:: Unsafe ) {
1799+ fn print_unsafety ( & mut self , s : ast:: Unsafe ) {
18061800 match s {
18071801 ast:: Unsafe :: No => { }
18081802 ast:: Unsafe :: Yes ( _) => self . word_nbsp ( "unsafe" ) ,
18091803 }
18101804 }
18111805
1812- pub ( crate ) fn print_constness ( & mut self , s : ast:: Const ) {
1806+ fn print_constness ( & mut self , s : ast:: Const ) {
18131807 match s {
18141808 ast:: Const :: No => { }
18151809 ast:: Const :: Yes ( _) => self . word_nbsp ( "const" ) ,
18161810 }
18171811 }
18181812
1819- pub ( crate ) fn print_is_auto ( & mut self , s : ast:: IsAuto ) {
1813+ fn print_is_auto ( & mut self , s : ast:: IsAuto ) {
18201814 match s {
18211815 ast:: IsAuto :: Yes => self . word_nbsp ( "auto" ) ,
18221816 ast:: IsAuto :: No => { }
0 commit comments