Skip to content

Commit bcf95fc

Browse files
committed
Add stdio configuring to run-make Rustc
1 parent b768b2e commit bcf95fc

File tree

1 file changed

+25
-0
lines changed
  • src/tools/run-make-support/src/external_deps

1 file changed

+25
-0
lines changed

src/tools/run-make-support/src/external_deps/rustc.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::ffi::{OsStr, OsString};
22
use std::path::Path;
3+
use std::process::Stdio;
34

45
use crate::command::Command;
56
use crate::env::env_var;
@@ -300,6 +301,30 @@ impl Rustc {
300301
self
301302
}
302303

304+
/// Configuration for the child process’s standard input (stdin) handle.
305+
///
306+
/// See [`std::process::Command::stdin`].
307+
pub fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self {
308+
self.cmd.stdin(cfg);
309+
self
310+
}
311+
312+
/// Configuration for the child process’s standard output (stdout) handle.
313+
///
314+
/// See [`std::process::Command::stdout`].
315+
pub fn stdout<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self {
316+
self.cmd.stdout(cfg);
317+
self
318+
}
319+
320+
/// Configuration for the child process’s standard error (stderr) handle.
321+
///
322+
/// See [`std::process::Command::stderr`].
323+
pub fn stderr<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self {
324+
self.cmd.stderr(cfg);
325+
self
326+
}
327+
303328
/// Specify the crate name.
304329
pub fn crate_name<S: AsRef<OsStr>>(&mut self, name: S) -> &mut Self {
305330
self.cmd.arg("--crate-name");

0 commit comments

Comments
 (0)