@@ -45,7 +45,9 @@ use crate::core::config::{
4545 DebuginfoLevel , DryRun , GccCiMode , LlvmLibunwind , Merge , ReplaceOpt , RustcLto , SplitDebuginfo ,
4646 StringOrBool , set, threads_from_config,
4747} ;
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+ } ;
4951use crate :: utils:: channel;
5052use crate :: utils:: exec:: { ExecutionContext , command} ;
5153use crate :: utils:: helpers:: { exe, get_host_target} ;
@@ -801,7 +803,8 @@ impl Config {
801803 }
802804 rustc
803805 } else {
804- config. download_beta_toolchain ( ) ;
806+ let dwn_ctx = DownloadContext :: from ( & config) ;
807+ download_beta_toolchain ( dwn_ctx) ;
805808 config
806809 . out
807810 . join ( config. host_target )
@@ -827,7 +830,8 @@ impl Config {
827830 }
828831 cargo
829832 } else {
830- config. download_beta_toolchain ( ) ;
833+ let dwn_ctx = DownloadContext :: from ( & config) ;
834+ download_beta_toolchain ( dwn_ctx) ;
831835 config. initial_sysroot . join ( "bin" ) . join ( exe ( "cargo" , config. host_target ) )
832836 } ;
833837
@@ -994,8 +998,12 @@ impl Config {
994998
995999 config. apply_dist_config ( toml. dist ) ;
9961000
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+ } ;
9991007
10001008 if matches ! ( config. lld_mode, LldMode :: SelfContained )
10011009 && !config. lld_enabled
0 commit comments