Skip to content

Commit

Permalink
Filter out unrecognized features
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 7, 2019
1 parent 5bac6fe commit 8986b69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Runner {

let features = features::find();

let project = Project {
let mut project = Project {
dir: path!(target_dir / "tests" / crate_name),
source_dir,
target_dir,
Expand All @@ -98,6 +98,10 @@ impl Runner {
let config = self.make_config();
let config_toml = toml::to_string(&config)?;

if let Some(enabled_features) = &mut project.features {
enabled_features.retain(|feature| manifest.features.contains_key(feature));
}

fs::create_dir_all(path!(project.dir / ".cargo"))?;
fs::write(path!(project.dir / ".cargo" / "config"), config_toml)?;
fs::write(path!(project.dir / "Cargo.toml"), manifest_toml)?;
Expand Down

0 comments on commit 8986b69

Please sign in to comment.