@@ -32,6 +32,8 @@ struct ToolBuild {
3232extra_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 {
100102if !self . allow_features . is_empty ( ) {
101103 cargo. allow_features ( self . allow_features ) ;
102104}
105+ cargo. args ( self . cargo_args ) ;
103106let _guard = builder. msg_tool (
104107Kind :: Build ,
105108self . 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 {
349353source_type : SourceType :: InTree ,
350354extra_features : Vec :: new ( ) ,
351355allow_features : "" ,
356+ cargo_args : Vec :: new ( ) ,
352357} )
353358}
354359}
@@ -403,6 +408,7 @@ impl Step for ErrorIndex {
403408source_type : SourceType :: InTree ,
404409extra_features : Vec :: new ( ) ,
405410allow_features : "" ,
411+ cargo_args : Vec :: new ( ) ,
406412} )
407413}
408414}
@@ -437,6 +443,7 @@ impl Step for RemoteTestServer {
437443source_type : SourceType :: InTree ,
438444extra_features : Vec :: new ( ) ,
439445allow_features : "" ,
446+ cargo_args : Vec :: new ( ) ,
440447} )
441448}
442449}
@@ -598,6 +605,7 @@ impl Step for Cargo {
598605source_type : SourceType :: Submodule ,
599606extra_features : Vec :: new ( ) ,
600607allow_features : "" ,
608+ cargo_args : Vec :: new ( ) ,
601609} )
602610}
603611}
@@ -625,6 +633,7 @@ impl Step for LldWrapper {
625633source_type : SourceType :: InTree ,
626634extra_features : Vec :: new ( ) ,
627635allow_features : "" ,
636+ cargo_args : Vec :: new ( ) ,
628637} )
629638}
630639}
@@ -673,6 +682,7 @@ impl Step for RustAnalyzer {
673682extra_features : vec ! [ "in-rust-tree" . to_owned( ) ] ,
674683source_type : SourceType :: InTree ,
675684allow_features : RustAnalyzer :: ALLOW_FEATURES ,
685+ cargo_args : Vec :: new ( ) ,
676686} )
677687}
678688}
@@ -720,6 +730,7 @@ impl Step for RustAnalyzerProcMacroSrv {
720730extra_features : vec ! [ "in-rust-tree" . to_owned( ) ] ,
721731source_type : SourceType :: InTree ,
722732allow_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
921933if ( false $( || !$add_bins_to_sysroot. is_empty( ) ) ?) && $sel. compiler. stage > 0 {
0 commit comments