epoch -> rust

This commit is contained in:
Manish Goregaokar 2018-02-06 09:33:30 -08:00
parent 5d615a69b7
commit 270f6e28a0
2 changed files with 7 additions and 7 deletions

View File

@ -441,7 +441,7 @@ pub struct TomlProject {
license_file: Option<String>,
repository: Option<String>,
metadata: Option<toml::Value>,
epoch: Option<String>,
rust: Option<String>,
}
#[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

View File

@ -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();