From: Manish Goregaokar Date: Tue, 6 Feb 2018 17:33:30 +0000 (-0800) Subject: epoch -> rust X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~10^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=270f6e28a028fd8b24b56c17fb509ab275860612;p=cargo.git epoch -> rust --- diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index e66ac7494..c33aaef93 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -441,7 +441,7 @@ pub struct TomlProject { license_file: Option, repository: Option, metadata: Option, - epoch: Option, + rust: Option, } #[derive(Debug, Deserialize, Serialize)] @@ -717,14 +717,14 @@ impl TomlManifest { None | Some(VecStringOrBool::Bool(true)) => None, }; - let epoch = if let Some(ref epoch) = project.epoch { + let epoch = if let Some(ref epoch) = project.rust { features.require(Feature::epoch()).chain_err(|| { "epoches are unstable" })?; if let Ok(epoch) = epoch.parse() { epoch } else { - bail!("the `epoch` key must be one of: `2015`, `2018`") + bail!("the `rust` key must be one of: `2015`, `2018`") } } else { Epoch::Epoch2015 diff --git a/tests/package.rs b/tests/package.rs index 4f10b9e53..f49a56193 100644 --- a/tests/package.rs +++ b/tests/package.rs @@ -897,7 +897,7 @@ fn test_epoch() { name = "foo" version = "0.0.1" authors = [] - epoch = "2018" + rust = "2018" "#) .file("src/lib.rs", r#" "#) .build(); @@ -957,7 +957,7 @@ fn test_epoch_malformed() { name = "foo" version = "0.0.1" authors = [] - epoch = "chicken" + rust = "chicken" "#) .file("src/lib.rs", r#" "#) .build(); @@ -970,7 +970,7 @@ fn test_epoch_malformed() { error: failed to parse manifest at `[..]` Caused by: - the `epoch` key must be one of: `2015`, `2018` + the `rust` key must be one of: `2015`, `2018` "))); } @@ -983,7 +983,7 @@ fn test_epoch_nightly() { name = "foo" version = "0.0.1" authors = [] - epoch = "2015" + rust = "2015" "#) .file("src/lib.rs", r#" "#) .build();