diff --git a/src/test/ui/compare-method/proj-outlives-region.stdout b/src/test/ui/compare-method/proj-outlives-region.stdout deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/compare-method/region-extra.stdout b/src/test/ui/compare-method/region-extra.stdout deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/compare-method/region-unrelated.stdout b/src/test/ui/compare-method/region-unrelated.stdout deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/const-eval/const_transmute.stderr b/src/test/ui/const-eval/const_transmute.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/const-expr-addr-operator.stderr b/src/test/ui/const-expr-addr-operator.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/const-pattern-not-const-evaluable.stderr b/src/test/ui/const-pattern-not-const-evaluable.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/feature-gate-const-indexing.stderr b/src/test/ui/feature-gate-const-indexing.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/issue-38875/issue_38875.stderr b/src/test/ui/issue-38875/issue_38875.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/nll/drop-may-dangle.stderr b/src/test/ui/nll/drop-may-dangle.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/nll/maybe-initialized-drop-uninitialized.stderr b/src/test/ui/nll/maybe-initialized-drop-uninitialized.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.stderr b/src/test/ui/nll/ty-outlives/ty-param-implied-bounds.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/print_type_sizes/anonymous.stderr b/src/test/ui/print_type_sizes/anonymous.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/print_type_sizes/anonymous.stdout b/src/test/ui/print_type_sizes/anonymous.stdout deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/print_type_sizes/multiple_types.stderr b/src/test/ui/print_type_sizes/multiple_types.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/print_type_sizes/packed.stderr b/src/test/ui/print_type_sizes/packed.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/print_type_sizes/repr-align.stderr b/src/test/ui/print_type_sizes/repr-align.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/reachable/expr_andand.stderr b/src/test/ui/reachable/expr_andand.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/reachable/expr_oror.stderr b/src/test/ui/reachable/expr_oror.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/rfc1598-generic-associated-types/shadowing.stdout b/src/test/ui/rfc1598-generic-associated-types/shadowing.stdout deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/trivial-bounds-inconsistent-associated-functions.stderr b/src/test/ui/trivial-bounds-inconsistent-associated-functions.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/ui/union/union-const-eval.stderr b/src/test/ui/union/union-const-eval.stderr deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 351005ff4b816..c15744078077e 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -10,32 +10,49 @@ //! Tidy check to ensure that there are no stray `.stderr` files in UI test directories. +use std::fs; use std::path::Path; pub fn check(path: &Path, bad: &mut bool) { - super::walk_many(&[&path.join("test/ui"), &path.join("test/ui-fulldeps")], - &mut |_| false, - &mut |file_path| { - if let Some(ext) = file_path.extension() { - if ext == "stderr" || ext == "stdout" { - // Test output filenames have the format: - // $testname.stderr - // $testname.$mode.stderr - // $testname.$revision.stderr - // $testname.$revision.$mode.stderr - // - // For now, just make sure that there is a corresponding - // $testname.rs file. - let testname = file_path.file_name().unwrap() - .to_str().unwrap() - .splitn(2, '.').next().unwrap(); - if !file_path.with_file_name(testname) - .with_extension("rs") - .exists() { - println!("Stray file with UI testing output: {:?}", file_path); - *bad = true; + super::walk_many( + &[&path.join("test/ui"), &path.join("test/ui-fulldeps")], + &mut |_| false, + &mut |file_path| { + if let Some(ext) = file_path.extension() { + if ext == "stderr" || ext == "stdout" { + // Test output filenames have the format: + // $testname.stderr + // $testname.$mode.stderr + // $testname.$revision.stderr + // $testname.$revision.$mode.stderr + // + // For now, just make sure that there is a corresponding + // $testname.rs file. + let testname = file_path + .file_name() + .unwrap() + .to_str() + .unwrap() + .splitn(2, '.') + .next() + .unwrap(); + if !file_path + .with_file_name(testname) + .with_extension("rs") + .exists() + { + println!("Stray file with UI testing output: {:?}", file_path); + *bad = true; + } + + if let Ok(metadata) = fs::metadata(file_path) { + if metadata.len() == 0 { + println!("Empty file with UI testing output: {:?}", file_path); + *bad = true; + } + } } } - } - }); + }, + ); }