mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
epoch -> rust
This commit is contained in:
parent
5d615a69b7
commit
270f6e28a0
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user