@@ -45,7 +45,9 @@ use crate::core::config::{
45
45
DebuginfoLevel , DryRun , GccCiMode , LlvmLibunwind , Merge , ReplaceOpt , RustcLto , SplitDebuginfo ,
46
46
StringOrBool , set, threads_from_config,
47
47
} ;
48
- use crate :: core:: download:: is_download_ci_available;
48
+ use crate :: core:: download:: {
49
+ DownloadContext , download_beta_toolchain, is_download_ci_available, maybe_download_rustfmt,
50
+ } ;
49
51
use crate :: utils:: channel;
50
52
use crate :: utils:: exec:: { ExecutionContext , command} ;
51
53
use crate :: utils:: helpers:: { exe, get_host_target} ;
@@ -801,7 +803,8 @@ impl Config {
801
803
}
802
804
rustc
803
805
} else {
804
- config. download_beta_toolchain ( ) ;
806
+ let dwn_ctx = DownloadContext :: from ( & config) ;
807
+ download_beta_toolchain ( dwn_ctx) ;
805
808
config
806
809
. out
807
810
. join ( config. host_target )
@@ -827,7 +830,8 @@ impl Config {
827
830
}
828
831
cargo
829
832
} else {
830
- config. download_beta_toolchain ( ) ;
833
+ let dwn_ctx = DownloadContext :: from ( & config) ;
834
+ download_beta_toolchain ( dwn_ctx) ;
831
835
config. initial_sysroot . join ( "bin" ) . join ( exe ( "cargo" , config. host_target ) )
832
836
} ;
833
837
@@ -994,8 +998,12 @@ impl Config {
994
998
995
999
config. apply_dist_config ( toml. dist ) ;
996
1000
997
- config. initial_rustfmt =
998
- if let Some ( r) = rustfmt { Some ( r) } else { config. maybe_download_rustfmt ( ) } ;
1001
+ config. initial_rustfmt = if let Some ( r) = rustfmt {
1002
+ Some ( r)
1003
+ } else {
1004
+ let dwn_ctx = DownloadContext :: from ( & config) ;
1005
+ maybe_download_rustfmt ( dwn_ctx)
1006
+ } ;
999
1007
1000
1008
if matches ! ( config. lld_mode, LldMode :: SelfContained )
1001
1009
&& !config. lld_enabled
0 commit comments