Skip to content

Commit

Permalink
tidy: println! -> eprintln!
Browse files Browse the repository at this point in the history
  • Loading branch information
clubby789 committed Dec 3, 2024
1 parent 2372561 commit 8374f7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/tools/tidy/src/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const IGNORE_UI_TEST_CHECK: &[&str] =
macro_rules! verbose_print {
($verbose:expr, $($fmt:tt)*) => {
if $verbose {
println!("{}", format_args!($($fmt)*));
eprintln!("{}", format_args!($($fmt)*));
}
};
}
Expand All @@ -49,8 +49,8 @@ pub fn check(root_path: &Path, search_paths: &[&Path], verbose: bool, bad: &mut
// Stage 1: create list
let error_codes = extract_error_codes(root_path, &mut errors);
if verbose {
println!("Found {} error codes", error_codes.len());
println!("Highest error code: `{}`", error_codes.iter().max().unwrap());
eprintln!("Found {} error codes", error_codes.len());
eprintln!("Highest error code: `{}`", error_codes.iter().max().unwrap());
}

// Stage 2: check list has docs
Expand Down
8 changes: 4 additions & 4 deletions src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ pub fn check(
.collect::<Vec<_>>();

for &(name, _) in gate_untested.iter() {
println!("Expected a gate test for the feature '{name}'.");
println!(
eprintln!("Expected a gate test for the feature '{name}'.");
eprintln!(
"Hint: create a failing test file named 'tests/ui/feature-gates/feature-gate-{}.rs',\
\n with its failures due to missing usage of `#![feature({})]`.",
name.replace("_", "-"),
name
);
println!(
eprintln!(
"Hint: If you already have such a test and don't want to rename it,\
\n you can also add a // gate-test-{} line to the test file.",
name
Expand Down Expand Up @@ -218,7 +218,7 @@ pub fn check(

lines.sort();
for line in lines {
println!("* {line}");
eprintln!("* {line}");
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/tools/tidy/src/unstable_book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ pub fn check(path: &Path, features: CollectedFeatures, bad: &mut bool) {
// List unstable features that don't have Unstable Book sections.
// Remove the comment marker if you want the list printed.
/*
println!("Lib features without unstable book sections:");
eprintln!("Lib features without unstable book sections:");
for feature_name in &unstable_lang_feature_names -
&unstable_book_lang_features_section_file_names {
println!(" * {} {:?}", feature_name, lib_features[&feature_name].tracking_issue);
eprintln!(" * {} {:?}", feature_name, lib_features[&feature_name].tracking_issue);
}
println!("Lang features without unstable book sections:");
eprintln!("Lang features without unstable book sections:");
for feature_name in &unstable_lib_feature_names-
&unstable_book_lib_features_section_file_names {
println!(" * {} {:?}", feature_name, lang_features[&feature_name].tracking_issue);
eprintln!(" * {} {:?}", feature_name, lang_features[&feature_name].tracking_issue);
}
// */
}
2 changes: 1 addition & 1 deletion src/tools/tidy/src/x_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {

if let Some(expected) = get_x_wrapper_version(root, cargo) {
if installed < expected {
return println!(
return eprintln!(
"Current version of x is {installed}, but the latest version is {expected}\nConsider updating to the newer version of x by running `cargo install --path src/tools/x`"
);
}
Expand Down

0 comments on commit 8374f7c

Please sign in to comment.