Skip to content

Commit d265538

Browse files
Rollup merge of rust-lang#126823 - GuillaumeGomez:migrate-run-make-inline-always-many-cgu, r=Kobzol
Migrate `run-make/inline-always-many-cgu` to `rmake.rs` Part of rust-lang#121876. r? `@jieyouxu`
2 parents 25bcc7d + e7dfd4a commit d265538

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ pub fn recursive_diff(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
387387
});
388388
}
389389

390-
pub fn read_dir<F: Fn(&Path)>(dir: impl AsRef<Path>, callback: F) {
390+
pub fn read_dir<F: FnMut(&Path)>(dir: impl AsRef<Path>, mut callback: F) {
391391
for entry in fs_wrapper::read_dir(dir) {
392392
callback(&entry.unwrap().path());
393393
}

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ run-make/foreign-rust-exceptions/Makefile
5252
run-make/include_bytes_deps/Makefile
5353
run-make/incr-add-rust-src-component/Makefile
5454
run-make/incr-foreign-head-span/Makefile
55-
run-make/inline-always-many-cgu/Makefile
5655
run-make/interdependent-c-libraries/Makefile
5756
run-make/intrinsic-unreachable/Makefile
5857
run-make/invalid-library/Makefile

tests/run-make/inline-always-many-cgu/Makefile

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use run_make_support::fs_wrapper::read_to_string;
2+
use run_make_support::regex::Regex;
3+
use run_make_support::{read_dir, rustc};
4+
5+
use std::ffi::OsStr;
6+
7+
fn main() {
8+
rustc().input("foo.rs").emit("llvm-ir").codegen_units(2).run();
9+
let re = Regex::new(r"\bcall\b").unwrap();
10+
let mut nb_ll = 0;
11+
read_dir(".", |path| {
12+
if path.is_file() && path.extension().is_some_and(|ext| ext == OsStr::new("ll")) {
13+
assert!(!re.is_match(&read_to_string(path)));
14+
nb_ll += 1;
15+
}
16+
});
17+
assert!(nb_ll > 0);
18+
}

0 commit comments

Comments
 (0)