From b83ef97efb5d8d2a0d15f3dcd84f3f5d65a98193 Mon Sep 17 00:00:00 2001 From: Eh2406 Date: Tue, 30 Jan 2018 23:09:13 -0500 Subject: [PATCH] add a -Z no-index-update for crater and benchmarking --- src/cargo/core/features.rs | 2 ++ src/cargo/sources/registry/remote.rs | 3 +++ 2 files changed, 5 insertions(+) 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 -- 2.30.2