diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-03-07 15:07:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 15:07:09 +0100 |
| commit | d03d9a4e9bea1d57d495449062d236aedda0f99d (patch) | |
| tree | 2ae43ae45938df5b1ffeee66b6d6169553462d38 | |
| parent | bb582c6d0f36207ed46f1bce8554d714b28980b1 (diff) | |
| parent | bf9782dd9d14268d0c72ac13b24fa35c6a2e5a57 (diff) | |
| download | rust-d03d9a4e9bea1d57d495449062d236aedda0f99d.tar.gz rust-d03d9a4e9bea1d57d495449062d236aedda0f99d.zip | |
Rollup merge of #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 https://github.com/rust-lang/rust/pull/120628#issuecomment-1973655740 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``
| -rw-r--r-- | src/tools/tidy/src/ui_tests.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index a9c5be913ba..1a53637ad42 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -190,7 +190,11 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) { let blessed_issues_path = tidy_src.join("issues_blessed.txt"); let mut blessed_issues_txt = fs::File::create(&blessed_issues_path).unwrap(); blessed_issues_txt.write(issues_txt_header.as_bytes()).unwrap(); - for filename in allowed_issue_names.difference(&remaining_issue_names) { + // If we changed paths to use the OS separator, reassert Unix chauvinism for blessing. + for filename in allowed_issue_names + .difference(&remaining_issue_names) + .map(|s| s.replace(std::path::MAIN_SEPARATOR_STR, "/")) + { write!(blessed_issues_txt, "\"{filename}\",\n").unwrap(); } write!(blessed_issues_txt, "]\n").unwrap(); |
