Skip to content

Commit

Permalink
Unrolled build for rust-lang#120018
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#120018 - Zalathar:mir-opt-html, r=Nilstrieb

Don't allow `.html` files in `tests/mir-opt/`

HTML files were needed for testing `-Z dump-mir-spanview`, but that flag has been removed by rust-lang#119566.
  • Loading branch information
rust-timer authored Jan 16, 2024
2 parents bf2637f + 40166c8 commit f0efe59
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/tools/miropt-test-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ pub fn files_for_miropt_test(
from_file = format!("{}.{}.mir", test_name, first_pass);
to_file = Some(second_file);
} else {
let ext_re = regex::Regex::new(r#"(\.(mir|dot|html))$"#).unwrap();
let cap = ext_re
.captures_iter(test_name)
.next()
.expect("test_name has an invalid extension");
// Allow-list for file extensions that can be produced by MIR dumps.
// Other extensions can be added here, as needed by new dump flags.
let ext_re = regex::Regex::new(r#"(\.(mir|dot))$"#).unwrap();
let cap = ext_re.captures_iter(test_name).next().unwrap_or_else(|| {
panic!("in {testfile:?}:\nEMIT_MIR has an unrecognized extension: {test_name}")
});
let extension = cap.get(1).unwrap().as_str();

expected_file =
Expand Down

0 comments on commit f0efe59

Please sign in to comment.