From: Eh2406 Date: Wed, 31 Jan 2018 04:09:13 +0000 (-0500) Subject: add a -Z no-index-update for crater and benchmarking X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~18^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b83ef97efb5d8d2a0d15f3dcd84f3f5d65a98193;p=cargo.git add a -Z no-index-update for crater and benchmarking --- diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index 3add03fcc..414e6a4a8 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -233,6 +233,7 @@ pub struct CliUnstable { pub print_im_a_teapot: bool, pub unstable_options: bool, pub offline: bool, + pub no_index_update: bool, } impl CliUnstable { @@ -264,6 +265,7 @@ impl CliUnstable { "print-im-a-teapot" => self.print_im_a_teapot = parse_bool(v)?, "unstable-options" => self.unstable_options = true, "offline" => self.offline = true, + "no-index-update" => self.no_index_update = true, _ => bail!("unknown `-Z` flag specified: {}", k), } diff --git a/src/cargo/sources/registry/remote.rs b/src/cargo/sources/registry/remote.rs index f21e54fa5..5ffabb9d5 100644 --- a/src/cargo/sources/registry/remote.rs +++ b/src/cargo/sources/registry/remote.rs @@ -156,6 +156,9 @@ impl<'cfg> RegistryData for RemoteRegistry<'cfg> { if self.config.cli_unstable().offline { return Ok(()); } + if self.config.cli_unstable().no_index_update { + return Ok(()); + } // Ensure that we'll actually be able to acquire an HTTP handle later on // once we start trying to download crates. This will weed out any