Skip to content

Commit 4483980

Browse files
Privatize and remove unused functions
1 parent ae5ed9b commit 4483980

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -346,26 +346,18 @@ pub fn item_to_string(i: &ast::Item) -> String {
346346
to_string(|s| s.print_item(i))
347347
}
348348

349-
pub fn impl_item_to_string(i: &ast::ImplItem) -> String {
349+
fn impl_item_to_string(i: &ast::ImplItem) -> String {
350350
to_string(|s| s.print_impl_item(i))
351351
}
352352

353-
pub fn trait_item_to_string(i: &ast::TraitItem) -> String {
353+
fn trait_item_to_string(i: &ast::TraitItem) -> String {
354354
to_string(|s| s.print_trait_item(i))
355355
}
356356

357357
pub fn generic_params_to_string(generic_params: &[ast::GenericParam]) -> String {
358358
to_string(|s| s.print_generic_params(generic_params))
359359
}
360360

361-
pub fn where_clause_to_string(i: &ast::WhereClause) -> String {
362-
to_string(|s| s.print_where_clause(i))
363-
}
364-
365-
pub fn fn_block_to_string(p: &ast::FnDecl) -> String {
366-
to_string(|s| s.print_fn_block_args(p))
367-
}
368-
369361
pub fn path_to_string(p: &ast::Path) -> String {
370362
to_string(|s| s.print_path(p, false, 0))
371363
}
@@ -378,7 +370,8 @@ pub fn vis_to_string(v: &ast::Visibility) -> String {
378370
to_string(|s| s.print_visibility(v))
379371
}
380372

381-
pub fn fun_to_string(decl: &ast::FnDecl,
373+
#[cfg(test)]
374+
fn fun_to_string(decl: &ast::FnDecl,
382375
header: ast::FnHeader,
383376
name: ast::Ident,
384377
generics: &ast::Generics)
@@ -392,7 +385,7 @@ pub fn fun_to_string(decl: &ast::FnDecl,
392385
})
393386
}
394387

395-
pub fn block_to_string(blk: &ast::Block) -> String {
388+
fn block_to_string(blk: &ast::Block) -> String {
396389
to_string(|s| {
397390
// containing cbox, will be closed by print-block at }
398391
s.cbox(INDENT_UNIT);
@@ -414,23 +407,20 @@ pub fn attribute_to_string(attr: &ast::Attribute) -> String {
414407
to_string(|s| s.print_attribute(attr))
415408
}
416409

417-
pub fn variant_to_string(var: &ast::Variant) -> String {
410+
#[cfg(test)]
411+
fn variant_to_string(var: &ast::Variant) -> String {
418412
to_string(|s| s.print_variant(var))
419413
}
420414

421415
pub fn arg_to_string(arg: &ast::Arg) -> String {
422416
to_string(|s| s.print_arg(arg, false))
423417
}
424418

425-
pub fn mac_to_string(arg: &ast::Mac) -> String {
426-
to_string(|s| s.print_mac(arg))
427-
}
428-
429-
pub fn foreign_item_to_string(arg: &ast::ForeignItem) -> String {
419+
fn foreign_item_to_string(arg: &ast::ForeignItem) -> String {
430420
to_string(|s| s.print_foreign_item(arg))
431421
}
432422

433-
pub fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
423+
fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
434424
format!("{}{}", to_string(|s| s.print_visibility(vis)), s)
435425
}
436426

0 commit comments

Comments
 (0)