Skip to content

Commit

Permalink
fix(cli.rs): improve rustc not found error msg (#6021)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Jan 17, 2023
1 parent 05662b3 commit 7aab3e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/cli-rustc-not-found-msg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cli.rs": "patch"
---

Improve the error message when `rustc` couldn't be found.
5 changes: 4 additions & 1 deletion tooling/cli/src/interface/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,10 @@ impl RustAppSettings {
.target()
.map(|t| t.to_string())
.unwrap_or_else(|| {
let output = Command::new("rustc").args(["-vV"]).output().unwrap();
let output = Command::new("rustc")
.args(["-vV"])
.output()
.expect("\"rustc\" could not be found, did you install Rust?");
let stdout = String::from_utf8_lossy(&output.stdout);
stdout
.split('\n')
Expand Down

0 comments on commit 7aab3e2

Please sign in to comment.