@@ -20,6 +20,7 @@ use crate::core::build_steps::llvm;
2020use crate :: core:: build_steps:: synthetic_targets:: MirOptPanicAbortSyntheticTarget ;
2121use crate :: core:: build_steps:: tool:: { self , SourceType , Tool } ;
2222use crate :: core:: build_steps:: toolstate:: ToolState ;
23+ use crate :: core:: builder;
2324use crate :: core:: builder:: crate_description;
2425use crate :: core:: builder:: { Builder , Compiler , Kind , RunConfig , ShouldRun , Step } ;
2526use crate :: core:: config:: flags:: get_completion;
@@ -380,7 +381,7 @@ impl Step for RustAnalyzer {
380381 // work in Rust CI
381382 cargo. env ( "SKIP_SLOW_TESTS" , "1" ) ;
382383
383- cargo. add_rustc_lib_path ( builder, compiler ) ;
384+ cargo. add_rustc_lib_path ( builder) ;
384385 run_cargo_test ( cargo, & [ ] , & [ ] , "rust-analyzer" , "rust-analyzer" , compiler, host, builder) ;
385386 }
386387}
@@ -426,7 +427,7 @@ impl Step for Rustfmt {
426427 t ! ( fs:: create_dir_all( & dir) ) ;
427428 cargo. env ( "RUSTFMT_TEST_DIR" , dir) ;
428429
429- cargo. add_rustc_lib_path ( builder, compiler ) ;
430+ cargo. add_rustc_lib_path ( builder) ;
430431
431432 run_cargo_test ( cargo, & [ ] , & [ ] , "rustfmt" , "rustfmt" , compiler, host, builder) ;
432433 }
@@ -476,7 +477,7 @@ impl Step for RustDemangler {
476477 t ! ( fs:: create_dir_all( & dir) ) ;
477478
478479 cargo. env ( "RUST_DEMANGLER_DRIVER_PATH" , rust_demangler) ;
479- cargo. add_rustc_lib_path ( builder, compiler ) ;
480+ cargo. add_rustc_lib_path ( builder) ;
480481
481482 run_cargo_test (
482483 cargo,
@@ -517,7 +518,7 @@ impl Miri {
517518 SourceType :: InTree ,
518519 & [ ] ,
519520 ) ;
520- cargo. add_rustc_lib_path ( builder, compiler ) ;
521+ cargo. add_rustc_lib_path ( builder) ;
521522 cargo. arg ( "--" ) . arg ( "miri" ) . arg ( "setup" ) ;
522523 cargo. arg ( "--target" ) . arg ( target. rustc_target_arg ( ) ) ;
523524
@@ -618,7 +619,7 @@ impl Step for Miri {
618619 ) ;
619620 let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "miri" , host, target) ;
620621
621- cargo. add_rustc_lib_path ( builder, compiler ) ;
622+ cargo. add_rustc_lib_path ( builder) ;
622623
623624 // miri tests need to know about the stage sysroot
624625 cargo. env ( "MIRI_SYSROOT" , & miri_sysroot) ;
@@ -671,7 +672,7 @@ impl Step for Miri {
671672 SourceType :: Submodule ,
672673 & [ ] ,
673674 ) ;
674- cargo. add_rustc_lib_path ( builder, compiler ) ;
675+ cargo. add_rustc_lib_path ( builder) ;
675676 cargo. arg ( "--" ) . arg ( "miri" ) . arg ( "test" ) ;
676677 if builder. config . locked_deps {
677678 cargo. arg ( "--locked" ) ;
@@ -788,7 +789,7 @@ impl Step for Clippy {
788789 let host_libs = builder. stage_out ( compiler, Mode :: ToolRustc ) . join ( builder. cargo_dir ( ) ) ;
789790 cargo. env ( "HOST_LIBS" , host_libs) ;
790791
791- cargo. add_rustc_lib_path ( builder, compiler ) ;
792+ cargo. add_rustc_lib_path ( builder) ;
792793 let mut cargo = prepare_cargo_test ( cargo, & [ ] , & [ ] , "clippy" , compiler, host, builder) ;
793794
794795 let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
@@ -2499,8 +2500,15 @@ impl Step for Crate {
24992500 // we're working with automatically.
25002501 let compiler = builder. compiler_for ( compiler. stage , compiler. host , target) ;
25012502
2502- let mut cargo =
2503- builder. cargo ( compiler, mode, SourceType :: InTree , target, builder. kind . as_str ( ) ) ;
2503+ let mut cargo = builder:: Cargo :: new (
2504+ builder,
2505+ compiler,
2506+ mode,
2507+ SourceType :: InTree ,
2508+ target,
2509+ builder. kind . as_str ( ) ,
2510+ ) ;
2511+
25042512 match mode {
25052513 Mode :: Std => {
25062514 compile:: std_cargo ( builder, target, compiler. stage , & mut cargo) ;
@@ -3134,13 +3142,15 @@ impl Step for CodegenCranelift {
31343142 let compiler = builder. compiler_for ( compiler. stage , compiler. host , target) ;
31353143
31363144 let build_cargo = || {
3137- let mut cargo = builder. cargo (
3145+ let mut cargo = builder:: Cargo :: new (
3146+ builder,
31383147 compiler,
31393148 Mode :: Codegen , // Must be codegen to ensure dlopen on compiled dylibs works
31403149 SourceType :: InTree ,
31413150 target,
31423151 "run" ,
31433152 ) ;
3153+
31443154 cargo. current_dir ( & builder. src . join ( "compiler/rustc_codegen_cranelift" ) ) ;
31453155 cargo
31463156 . arg ( "--manifest-path" )
@@ -3260,13 +3270,15 @@ impl Step for CodegenGCC {
32603270 let compiler = builder. compiler_for ( compiler. stage , compiler. host , target) ;
32613271
32623272 let build_cargo = || {
3263- let mut cargo = builder. cargo (
3273+ let mut cargo = builder:: Cargo :: new (
3274+ builder,
32643275 compiler,
32653276 Mode :: Codegen , // Must be codegen to ensure dlopen on compiled dylibs works
32663277 SourceType :: InTree ,
32673278 target,
32683279 "run" ,
32693280 ) ;
3281+
32703282 cargo. current_dir ( & builder. src . join ( "compiler/rustc_codegen_gcc" ) ) ;
32713283 cargo
32723284 . arg ( "--manifest-path" )
0 commit comments