Skip to content

Commit

Permalink
Auto merge of #3771 - alexcrichton:read-more, r=matklad
Browse files Browse the repository at this point in the history
Accept `default_features` for `default-features`

This was accepted by this historical TOML parser, so we'll need to preserve this
ability.

Closes #3768
  • Loading branch information
bors committed Feb 28, 2017
2 parents 79c743a + fd25593 commit 09b68aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cargo/util/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ pub struct DetailedTomlDependency {
optional: Option<bool>,
#[serde(rename = "default-features")]
default_features: Option<bool>,
#[serde(rename = "default_features")]
default_features2: Option<bool>,
}

#[derive(Deserialize)]
Expand Down Expand Up @@ -947,7 +949,9 @@ impl TomlDependency {
None => DependencyInner::parse(name, version, &new_source_id, None)?,
};
dep = dep.set_features(details.features.unwrap_or(Vec::new()))
.set_default_features(details.default_features.unwrap_or(true))
.set_default_features(details.default_features
.or(details.default_features2)
.unwrap_or(true))
.set_optional(details.optional.unwrap_or(false))
.set_platform(cx.platform.clone());
if let Some(kind) = kind {
Expand Down

0 comments on commit 09b68aa

Please sign in to comment.