File tree 3 files changed +20
-2
lines changed
src/tools/run-make-support/src
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ impl Command {
63
63
}
64
64
}
65
65
66
+ // Internal-only.
67
+ pub ( crate ) fn into_raw_command ( mut self ) -> std:: process:: Command {
68
+ self . drop_bomb . defuse ( ) ;
69
+ self . cmd
70
+ }
71
+
66
72
/// Specify a stdin input buffer. This is a convenience helper,
67
73
pub fn stdin_buf < I : AsRef < [ u8 ] > > ( & mut self , input : I ) -> & mut Self {
68
74
self . stdin_buf = Some ( input. as_ref ( ) . to_vec ( ) . into_boxed_slice ( ) ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use crate::command::Command;
5
5
use crate :: env:: env_var;
6
6
use crate :: util:: set_host_compiler_dylib_path;
7
7
8
- /// Construct a new `rustdoc` invocation.
8
+ /// Construct a new `rustdoc` invocation. This will configure the host compiler runtime libs.
9
9
#[ track_caller]
10
10
pub fn rustdoc ( ) -> Rustdoc {
11
11
Rustdoc :: new ( )
@@ -28,7 +28,7 @@ fn setup_common() -> Command {
28
28
}
29
29
30
30
impl Rustdoc {
31
- /// Construct a bare `rustdoc` invocation.
31
+ /// Construct a bare `rustdoc` invocation. This will configure the host compiler runtime libs.
32
32
#[ track_caller]
33
33
pub fn new ( ) -> Self {
34
34
let cmd = setup_common ( ) ;
Original file line number Diff line number Diff line change 28
28
macro_rules! impl_common_helpers {
29
29
( $wrapper: ident) => {
30
30
impl $wrapper {
31
+ /// In very rare circumstances, you may need a e.g. `bare_rustc()` or `bare_rustdoc()`
32
+ /// with host runtime libs configured, but want the underlying raw
33
+ /// [`std::process::Command`] (e.g. for manipulating pipes or whatever). This function
34
+ /// will consume the command wrapper and extract the underlying
35
+ /// [`std::process::Command`].
36
+ ///
37
+ /// Caution: this will mean that you can no longer use the convenience methods on the
38
+ /// command wrapper. Use as a last resort.
39
+ pub fn into_raw_command( self ) -> :: std:: process:: Command {
40
+ self . cmd. into_raw_command( )
41
+ }
42
+
31
43
/// Specify an environment variable.
32
44
pub fn env<K , V >( & mut self , key: K , value: V ) -> & mut Self
33
45
where
You can’t perform that action at this time.
0 commit comments