about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/run-make-support/src/rustdoc.rs11
-rw-r--r--tests/run-make/exit-code/rmake.rs3
2 files changed, 5 insertions, 9 deletions
diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-support/src/rustdoc.rs
index cbf328b67fd..1fb4b589d76 100644
--- a/src/tools/run-make-support/src/rustdoc.rs
+++ b/src/tools/run-make-support/src/rustdoc.rs
@@ -1,4 +1,5 @@
 use std::env;
+use std::ffi::OsStr;
 use std::path::Path;
 use std::process::{Command, Output};
 
@@ -58,18 +59,12 @@ impl Rustdoc {
         self
     }
 
-    /// Fallback argument provider. Consider adding meaningfully named methods instead of using
-    /// this method.
-    pub fn arg(&mut self, arg: &str) -> &mut Self {
+    /// Generic command argument provider. Use `.arg("-Zname")` over `.arg("-Z").arg("arg")`.
+    pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self {
         self.cmd.arg(arg);
         self
     }
 
-    pub fn arg_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
-        self.cmd.arg(path.as_ref());
-        self
-    }
-
     /// Run the build `rustdoc` command and assert that the run is successful.
     #[track_caller]
     pub fn run(&mut self) -> Output {
diff --git a/tests/run-make/exit-code/rmake.rs b/tests/run-make/exit-code/rmake.rs
index 8fcdb4acdc5..f387626287e 100644
--- a/tests/run-make/exit-code/rmake.rs
+++ b/tests/run-make/exit-code/rmake.rs
@@ -25,7 +25,8 @@ fn main() {
 
     rustdoc()
         .arg("success.rs")
-        .arg("-o").arg_path(tmp_dir().join("exit-code"))
+        .arg("-o")
+        .arg(tmp_dir().join("exit-code"))
         .run();
 
     rustdoc()