File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
src/tools/run-make-support/src Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ impl Command {
6363 }
6464 }
6565
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+
6672 /// Specify a stdin input buffer. This is a convenience helper,
6773 pub fn stdin_buf < I : AsRef < [ u8 ] > > ( & mut self , input : I ) -> & mut Self {
6874 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;
55use crate :: env:: env_var;
66use crate :: util:: set_host_compiler_dylib_path;
77
8- /// Construct a new `rustdoc` invocation.
8+ /// Construct a new `rustdoc` invocation. This will configure the host compiler runtime libs.
99#[ track_caller]
1010pub fn rustdoc ( ) -> Rustdoc {
1111 Rustdoc :: new ( )
@@ -28,7 +28,7 @@ fn setup_common() -> Command {
2828}
2929
3030impl Rustdoc {
31- /// Construct a bare `rustdoc` invocation.
31+ /// Construct a bare `rustdoc` invocation. This will configure the host compiler runtime libs.
3232 #[ track_caller]
3333 pub fn new ( ) -> Self {
3434 let cmd = setup_common ( ) ;
Original file line number Diff line number Diff line change 2828macro_rules! impl_common_helpers {
2929 ( $wrapper: ident) => {
3030 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+
3143 /// Specify an environment variable.
3244 pub fn env<K , V >( & mut self , key: K , value: V ) -> & mut Self
3345 where
You can’t perform that action at this time.
0 commit comments