Skip to content

Commit

Permalink
epoch -> rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Feb 6, 2018
1 parent 5d615a6 commit 270f6e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ fn test_epoch() {
name = "foo"
version = "0.0.1"
authors = []
epoch = "2018"
rust = "2018"
"#)
.file("src/lib.rs", r#" "#)
.build();
Expand Down Expand Up @@ -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();
Expand All @@ -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`
")));
}

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

0 comments on commit 270f6e2

Please sign in to comment.