@@ -32,6 +32,8 @@ struct ToolBuild {
3232    extra_features :  Vec < String > , 
3333    /// Nightly-only features that are allowed (comma-separated list). 
3434allow_features :  & ' static  str , 
35+     /// Additional arguments to pass to the `cargo` invocation. 
36+ cargo_args :  Vec < String > , 
3537} 
3638
3739impl  Builder < ' _ >  { 
@@ -100,6 +102,7 @@ impl Step for ToolBuild {
100102        if  !self . allow_features . is_empty ( )  { 
101103            cargo. allow_features ( self . allow_features ) ; 
102104        } 
105+         cargo. args ( self . cargo_args ) ; 
103106        let  _guard = builder. msg_tool ( 
104107            Kind :: Build , 
105108            self . mode , 
@@ -283,6 +286,7 @@ macro_rules! bootstrap_tool {
283286                    } , 
284287                    extra_features:  vec![ ] , 
285288                    allow_features:  concat!( $( $allow_features) * ) , 
289+                     cargo_args:  vec![ ] 
286290                } ) 
287291            } 
288292        } 
@@ -349,6 +353,7 @@ impl Step for OptimizedDist {
349353            source_type :  SourceType :: InTree , 
350354            extra_features :  Vec :: new ( ) , 
351355            allow_features :  "" , 
356+             cargo_args :  Vec :: new ( ) , 
352357        } ) 
353358    } 
354359} 
@@ -403,6 +408,7 @@ impl Step for ErrorIndex {
403408            source_type :  SourceType :: InTree , 
404409            extra_features :  Vec :: new ( ) , 
405410            allow_features :  "" , 
411+             cargo_args :  Vec :: new ( ) , 
406412        } ) 
407413    } 
408414} 
@@ -437,6 +443,7 @@ impl Step for RemoteTestServer {
437443            source_type :  SourceType :: InTree , 
438444            extra_features :  Vec :: new ( ) , 
439445            allow_features :  "" , 
446+             cargo_args :  Vec :: new ( ) , 
440447        } ) 
441448    } 
442449} 
@@ -598,6 +605,7 @@ impl Step for Cargo {
598605            source_type :  SourceType :: Submodule , 
599606            extra_features :  Vec :: new ( ) , 
600607            allow_features :  "" , 
608+             cargo_args :  Vec :: new ( ) , 
601609        } ) 
602610    } 
603611} 
@@ -625,6 +633,7 @@ impl Step for LldWrapper {
625633            source_type :  SourceType :: InTree , 
626634            extra_features :  Vec :: new ( ) , 
627635            allow_features :  "" , 
636+             cargo_args :  Vec :: new ( ) , 
628637        } ) 
629638    } 
630639} 
@@ -673,6 +682,7 @@ impl Step for RustAnalyzer {
673682            extra_features :  vec ! [ "in-rust-tree" . to_owned( ) ] , 
674683            source_type :  SourceType :: InTree , 
675684            allow_features :  RustAnalyzer :: ALLOW_FEATURES , 
685+             cargo_args :  Vec :: new ( ) , 
676686        } ) 
677687    } 
678688} 
@@ -720,6 +730,7 @@ impl Step for RustAnalyzerProcMacroSrv {
720730            extra_features :  vec ! [ "in-rust-tree" . to_owned( ) ] , 
721731            source_type :  SourceType :: InTree , 
722732            allow_features :  RustAnalyzer :: ALLOW_FEATURES , 
733+             cargo_args :  Vec :: new ( ) , 
723734        } ) ; 
724735
725736        // Copy `rust-analyzer-proc-macro-srv` to `<sysroot>/libexec/` 
@@ -916,6 +927,7 @@ macro_rules! tool_extended {
916927                    extra_features:  $sel. extra_features, 
917928                    source_type:  SourceType :: InTree , 
918929                    allow_features:  concat!( $( $allow_features) * ) , 
930+                     cargo_args:  vec![ ] 
919931                } ) ; 
920932
921933                if  ( false  $( || !$add_bins_to_sysroot. is_empty( ) ) ?)  && $sel. compiler. stage > 0  { 
0 commit comments