Skip to content

Commit 70aa534

Browse files
Avoid panicking when Cargo.toml is not present
1 parent 86bb8eb commit 70aa534

File tree

1 file changed

+5
-1
lines changed
  • src/tools/miri/cargo-miri/src

1 file changed

+5
-1
lines changed

src/tools/miri/cargo-miri/src/util.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ fn cargo_extra_flags() -> Vec<String> {
213213

214214
pub fn get_cargo_metadata() -> Metadata {
215215
// This will honor the `CARGO` env var the same way our `cargo()` does.
216-
MetadataCommand::new().no_deps().other_options(cargo_extra_flags()).exec().unwrap()
216+
MetadataCommand::new()
217+
.no_deps()
218+
.other_options(cargo_extra_flags())
219+
.exec()
220+
.unwrap_or_else(|err| show_error!("{}", err))
217221
}
218222

219223
/// Pulls all the crates in this workspace from the cargo metadata.

0 commit comments

Comments
 (0)