Skip to content

Commit d03d9a4

Browse files
Rollup merge of rust-lang#122126 - workingjubilee:every-os-in-the-world-belongs-to-unix, r=ChrisDenton
Fix `tidy --bless` on ̶X̶e̶n̶i̶x̶ Windows As reported in rust-lang#120628 (comment) the requested `tidy --bless` implementation didn't take into account the fact that earlier the linting code canonicalized things to use the OS path separator. This makes it so that the path separator is always rewritten back as '/', which should fix the variance there. r? ``@ChrisDenton``
2 parents bb582c6 + bf9782d commit d03d9a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/tools/tidy/src/ui_tests.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
190190
let blessed_issues_path = tidy_src.join("issues_blessed.txt");
191191
let mut blessed_issues_txt = fs::File::create(&blessed_issues_path).unwrap();
192192
blessed_issues_txt.write(issues_txt_header.as_bytes()).unwrap();
193-
for filename in allowed_issue_names.difference(&remaining_issue_names) {
193+
// If we changed paths to use the OS separator, reassert Unix chauvinism for blessing.
194+
for filename in allowed_issue_names
195+
.difference(&remaining_issue_names)
196+
.map(|s| s.replace(std::path::MAIN_SEPARATOR_STR, "/"))
197+
{
194198
write!(blessed_issues_txt, "\"{filename}\",\n").unwrap();
195199
}
196200
write!(blessed_issues_txt, "]\n").unwrap();

0 commit comments

Comments
 (0)