From fa5be237c5268810c1a677a28a21fa227d0a54a7 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 5 Feb 2018 10:28:17 -0500 Subject: [PATCH] Feature gate epoches --- src/cargo/core/features.rs | 3 +++ src/cargo/util/toml/mod.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index 30c2b433f..10597e55e 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -146,6 +146,9 @@ features! { // Downloading packages from alternative registry indexes. [unstable] alternative_registries: bool, + + // Using epochs + [unstable] epoch: bool, } } diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index d2e47a692..623d794af 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -718,6 +718,9 @@ impl TomlManifest { }; let epoch = if let Some(ref epoch) = project.epoch { + features.require(Feature::epoch()).chain_err(|| { + "epoches are unstable" + })?; if let Ok(epoch) = epoch.parse() { epoch } else { -- 2.30.2