about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEtomicBomb <ethan@ethan.ws>2024-07-25 17:59:32 +0000
committerEtomicBomb <ethan@ethan.ws>2024-07-29 14:34:35 +0000
commit12d87ee237a1f79c00ccd22424432f5ab869ed22 (patch)
tree9f9d19f158e2c2c9912a02d6c924eb51bc166d30
parentf6f0ef46f5a9f368183e8c59ee82d0319af7ec9c (diff)
downloadrust-12d87ee237a1f79c00ccd22424432f5ab869ed22.tar.gz
rust-12d87ee237a1f79c00ccd22424432f5ab869ed22.zip
file_stem and comment per notriddle
-rw-r--r--src/tools/compiletest/src/runtest.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 2d298dfbc06..2beff593f08 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1610,6 +1610,8 @@ impl<'test> TestCx<'test> {
                 };
                 // Create the directory for the stdout/stderr files.
                 create_dir_all(aux_cx.output_base_dir()).unwrap();
+                // use root_testpaths here, because aux-builds should have the
+                // same --out-dir and auxiliary directory.
                 let auxres = aux_cx.document(&root_out_dir, root_testpaths);
                 if !auxres.status.success() {
                     return auxres;
@@ -1624,14 +1626,7 @@ impl<'test> TestCx<'test> {
         // actual --out-dir given to the auxiliary or test, as opposed to the root out dir for the entire
         // test
         let out_dir: Cow<'_, Path> = if self.props.unique_doc_out_dir {
-            let file_name = self
-                .testpaths
-                .file
-                .file_name()
-                .expect("file name should not be empty")
-                .to_str()
-                .expect("file name utf8")
-                .trim_end_matches(".rs");
+            let file_name = self.testpaths.file.file_stem().expect("file name should not be empty");
             let out_dir = PathBuf::from_iter([
                 root_out_dir,
                 Path::new("docs"),