Skip to content

Commit 4a00deb

Browse files
Add crate_name method to Rustdoc and Rustc
1 parent 23e965e commit 4a00deb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: src/tools/run-make-support/src/rustc.rs

+7
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ impl Rustc {
176176
self
177177
}
178178

179+
/// Specify the crate name.
180+
pub fn crate_name(&mut self, name: &str) -> &mut Self {
181+
self.cmd.arg("--crate-name");
182+
self.cmd.arg(name);
183+
self
184+
}
185+
179186
/// Get the [`Output`][::std::process::Output] of the finished process.
180187
#[track_caller]
181188
pub fn command_output(&mut self) -> ::std::process::Output {

Diff for: src/tools/run-make-support/src/rustdoc.rs

+7
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ impl Rustdoc {
114114
self
115115
}
116116

117+
/// Specify the crate name.
118+
pub fn crate_name(&mut self, name: &str) -> &mut Self {
119+
self.cmd.arg("--crate-name");
120+
self.cmd.arg(name);
121+
self
122+
}
123+
117124
#[track_caller]
118125
pub fn run_fail_assert_exit_code(&mut self, code: i32) -> Output {
119126
let caller_location = std::panic::Location::caller();

0 commit comments

Comments
 (0)