Skip to content

Commit da27c97

Browse files
committed
Auto merge of rust-lang#11905 - pgerber:tests, r=dswij
Tolerate hidden, binary files in tests/ Avoid scanning temporary files created by editors like this one created by Vim: ---- old_test_headers stdout ---- thread 'old_test_headers' panicked at tests/headers.rs:19:74: tests/ui/.regex.rs.swp: stream did not contain valid UTF-8 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace changelog: none
2 parents 31aa0b2 + 1e67f6c commit da27c97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/headers.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ fn old_test_headers() {
1212

1313
for entry in WalkDir::new("tests") {
1414
let entry = entry.unwrap();
15-
if !entry.file_type().is_file() {
15+
let is_hidden_file = entry
16+
.file_name()
17+
.to_str()
18+
.expect("non-UTF-8 file name")
19+
.starts_with('.');
20+
if is_hidden_file || !entry.file_type().is_file() {
1621
continue;
1722
}
1823

0 commit comments

Comments
 (0)