Skip to content

Commit bdc6b4d

Browse files
authored
Rollup merge of rust-lang#136441 - jieyouxu:cleanup-is-rustdoc, r=compiler-errors
[`compiletest`-related cleanups 1/7] Cleanup `is_rustdoc` logic and remove a useless path join in rustdoc-json runtest logic Reference for overall changes: rust-lang#136437 Part **1** of **7** of the *`compiletest`-related cleanups* PR series. ### Summary - Don't match on path when we already have test suite names. - Remove a useless path join. r? bootstrap (or compiler)
2 parents 43764db + 4d0cb42 commit bdc6b4d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Diff for: src/tools/compiletest/src/runtest.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1417,9 +1417,7 @@ impl<'test> TestCx<'test> {
14171417
}
14181418

14191419
fn is_rustdoc(&self) -> bool {
1420-
self.config.src_base.ends_with("rustdoc-ui")
1421-
|| self.config.src_base.ends_with("rustdoc-js")
1422-
|| self.config.src_base.ends_with("rustdoc-json")
1420+
matches!(self.config.suite.as_str(), "rustdoc-ui" | "rustdoc-js" | "rustdoc-json")
14231421
}
14241422

14251423
fn get_mir_dump_dir(&self) -> PathBuf {

Diff for: src/tools/compiletest/src/runtest/rustdoc_json.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ impl TestCx<'_> {
1616
self.fatal_proc_rec("rustdoc failed!", &proc_res);
1717
}
1818

19-
let root = self.config.find_rust_src_root().unwrap();
2019
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
2120
json_out.set_extension("json");
2221
let res = self.run_command_to_procres(
2322
Command::new(self.config.jsondocck_path.as_ref().unwrap())
2423
.arg("--doc-dir")
25-
.arg(root.join(&out_dir))
24+
.arg(&out_dir)
2625
.arg("--template")
2726
.arg(&self.testpaths.file),
2827
);

0 commit comments

Comments
 (0)