@@ -231,20 +231,21 @@ impl Toolchain {
231
231
. map_err ( InstallError :: Download ) ?;
232
232
}
233
233
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
238
237
// 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
+ }
248
249
249
250
if dl_params. install_src {
250
251
let filename = "rust-src-nightly" ;
@@ -411,6 +412,7 @@ pub(crate) struct DownloadParams {
411
412
tmp_dir : PathBuf ,
412
413
install_dir : PathBuf ,
413
414
install_src : bool ,
415
+ without_cargo : bool ,
414
416
force_install : bool ,
415
417
}
416
418
@@ -435,6 +437,7 @@ impl DownloadParams {
435
437
tmp_dir : cfg. rustup_tmp_path . clone ( ) ,
436
438
install_dir : cfg. toolchains_path . clone ( ) ,
437
439
install_src : cfg. args . with_src ,
440
+ without_cargo : cfg. args . without_cargo ,
438
441
force_install : cfg. args . force_install ,
439
442
}
440
443
}
0 commit comments