Skip to content

Commit 39bb14e

Browse files
Improve run-make/output-type-permutations code and improve filename_not_in_denylist API
1 parent 98dcbae commit 39bb14e

File tree

2 files changed

+4
-4
lines changed
  • src/tools/run-make-support/src
  • tests/run-make/output-type-permutations

2 files changed

+4
-4
lines changed

src/tools/run-make-support/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ pub fn not_contains<P: AsRef<Path>>(path: P, expected: &str) -> bool {
296296
}
297297

298298
/// Returns true if the filename at `path` is not in `expected`.
299-
pub fn filename_not_in_denylist<P: AsRef<Path>>(path: P, expected: &[String]) -> bool {
299+
pub fn filename_not_in_denylist<P: AsRef<Path>, V: AsRef<[String]>>(path: P, expected: V) -> bool {
300+
let expected = expected.as_ref();
300301
path.as_ref()
301302
.file_name()
302303
.is_some_and(|name| !expected.contains(&name.to_str().unwrap().to_owned()))

tests/run-make/output-type-permutations/rmake.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ use std::path::PathBuf;
1717
// `rustc_invocation`: the rustc command being tested
1818
// Any unexpected output files not listed in `must_exist` or `can_exist` will cause a failure.
1919
fn assert_expected_output_files(expectations: Expectations, rustc_invocation: impl Fn()) {
20-
let must_exist = expectations.expected_files;
21-
let can_exist = expectations.allowed_files;
22-
let dir = expectations.test_dir;
20+
let Expectations { expected_files: must_exist, allowed_files: can_exist, test_dir: dir } =
21+
expectations;
2322

2423
fs_wrapper::create_dir(&dir);
2524
rustc_invocation();

0 commit comments

Comments
 (0)