@@ -231,20 +231,21 @@ impl Toolchain {
231231 . map_err ( InstallError :: Download ) ?;
232232 }
233233
234- // download nightly cargo by default
235- // this behavior was changed from an
236- // optional feature with the `--with-cargo`
237- // flag as of v0.6.0
234+ // download cargo by default
235+ // deactivate with the `--without-cargo` flag
236+ // this default behavior was changed as of v0.6.0
238237 // see: https://github.com/rust-lang/cargo-bisect-rustc/issues/81
239- let filename = format ! ( "cargo-nightly-{}" , self . host) ;
240- download_tarball (
241- & client,
242- & format ! ( "cargo for {}" , self . host) ,
243- & format ! ( "{}/{}/{}.tar" , dl_params. url_prefix, location, filename, ) ,
244- Some ( & PathBuf :: from ( & filename) . join ( "cargo" ) ) ,
245- tmpdir. path ( ) ,
246- )
247- . map_err ( InstallError :: Download ) ?;
238+ if !dl_params. without_cargo {
239+ let filename = format ! ( "cargo-nightly-{}" , self . host) ;
240+ download_tarball (
241+ & client,
242+ & format ! ( "cargo for {}" , self . host) ,
243+ & format ! ( "{}/{}/{}.tar" , dl_params. url_prefix, location, filename, ) ,
244+ Some ( & PathBuf :: from ( & filename) . join ( "cargo" ) ) ,
245+ tmpdir. path ( ) ,
246+ )
247+ . map_err ( InstallError :: Download ) ?;
248+ }
248249
249250 if dl_params. install_src {
250251 let filename = "rust-src-nightly" ;
@@ -411,6 +412,7 @@ pub(crate) struct DownloadParams {
411412 tmp_dir : PathBuf ,
412413 install_dir : PathBuf ,
413414 install_src : bool ,
415+ without_cargo : bool ,
414416 force_install : bool ,
415417}
416418
@@ -435,6 +437,7 @@ impl DownloadParams {
435437 tmp_dir : cfg. rustup_tmp_path . clone ( ) ,
436438 install_dir : cfg. toolchains_path . clone ( ) ,
437439 install_src : cfg. args . with_src ,
440+ without_cargo : cfg. args . without_cargo ,
438441 force_install : cfg. args . force_install ,
439442 }
440443 }
0 commit comments