add a -Z no-index-update for crater and benchmarking
authorEh2406 <YeomanYaacov@gmail.com>
Wed, 31 Jan 2018 04:09:13 +0000 (23:09 -0500)
committerEh2406 <YeomanYaacov@gmail.com>
Wed, 31 Jan 2018 04:09:13 +0000 (23:09 -0500)
src/cargo/core/features.rs
src/cargo/sources/registry/remote.rs

index 3add03fcc3873314990960ac86e655100d7aee1f..414e6a4a8b6947aa7b967023c326d512c8103016 100644 (file)
@@ -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),
         }
 
index f21e54fa58edc53423a25461e95b65f7cc4c34d3..5ffabb9d5b52e848e48645db58c46cfad3c1ea7d 100644 (file)
@@ -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