diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-05-11 20:32:19 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-05-11 21:09:00 +0200 |
| commit | 4a00debfefda0ea72735252e098bd303df6a3ff3 (patch) | |
| tree | 09e4222cf56ae4f06d320e86ee0636ca25ceac9b /src | |
| parent | 23e965eb68f5e903cbcb3bf86ca3431e4c272586 (diff) | |
| download | rust-4a00debfefda0ea72735252e098bd303df6a3ff3.tar.gz rust-4a00debfefda0ea72735252e098bd303df6a3ff3.zip | |
Add `crate_name` method to `Rustdoc` and `Rustc`
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/run-make-support/src/rustc.rs | 7 | ||||
| -rw-r--r-- | src/tools/run-make-support/src/rustdoc.rs | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/run-make-support/src/rustc.rs b/src/tools/run-make-support/src/rustc.rs index de773d688ef..852353575a9 100644 --- a/src/tools/run-make-support/src/rustc.rs +++ b/src/tools/run-make-support/src/rustc.rs @@ -176,6 +176,13 @@ impl Rustc { self } + /// Specify the crate name. + pub fn crate_name(&mut self, name: &str) -> &mut Self { + self.cmd.arg("--crate-name"); + self.cmd.arg(name); + self + } + /// Get the [`Output`][::std::process::Output] of the finished process. #[track_caller] pub fn command_output(&mut self) -> ::std::process::Output { diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-support/src/rustdoc.rs index dcd5b5a93e1..df91742f4e2 100644 --- a/src/tools/run-make-support/src/rustdoc.rs +++ b/src/tools/run-make-support/src/rustdoc.rs @@ -114,6 +114,13 @@ impl Rustdoc { self } + /// Specify the crate name. + pub fn crate_name(&mut self, name: &str) -> &mut Self { + self.cmd.arg("--crate-name"); + self.cmd.arg(name); + self + } + #[track_caller] pub fn run_fail_assert_exit_code(&mut self, code: i32) -> Output { let caller_location = std::panic::Location::caller(); |
