Skip to content

Commit

Permalink
Auto merge of #1002 - RalfJung:workspace, r=RalfJung
Browse files Browse the repository at this point in the history
better error when using cargo-miri in a workspace
  • Loading branch information
bors committed Oct 16, 2019
2 parents b20ea83 + 2967d0d commit 089c7e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn list_targets() -> impl Iterator<Item=cargo_metadata::Target> {
let mut metadata = if let Ok(metadata) = cmd.exec() {
metadata
} else {
show_error(format!("Could not obtain Cargo metadata"));
show_error(format!("Could not obtain Cargo metadata; likely an ill-formed manifest"));
};

let current_dir = std::env::current_dir();
Expand All @@ -113,7 +113,7 @@ fn list_targets() -> impl Iterator<Item=cargo_metadata::Target> {
package_manifest_directory == current_dir
}
})
.expect("could not find matching package");
.unwrap_or_else(|| show_error(format!("This seems to be a workspace, which is not supported by cargo-miri")));
let package = metadata.packages.remove(package_index);

// Finally we got the list of targets to build
Expand Down

0 comments on commit 089c7e8

Please sign in to comment.