Skip to content

Commit

Permalink
Use correct name for undefined linked toolchain invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Mar 24, 2017
1 parent ebd92af commit ded5ee2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rustup/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl<'a> Toolchain<'a> {
return Err(ErrorKind::ToolchainNotInstalled(self.name.to_owned()).into());
}
if !primary_toolchain.exists() {
return Err(ErrorKind::ToolchainNotInstalled(self.name.to_owned()).into());
return Err(ErrorKind::ToolchainNotInstalled(primary_toolchain.name.to_owned()).into());
}

let src_file = self.path.join("bin").join(format!("cargo{}", EXE_SUFFIX));
Expand Down
11 changes: 11 additions & 0 deletions tests/cli-exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,14 @@ fn disable_telemetry() {
&format!("info: telemetry set to 'off'\n"));
});
}

// issue #927
#[test]
fn undefined_linked_toolchain() {
setup(&|config| {
expect_err_ex(config,
&["cargo", "+bogus", "test"],
r"",
&format!("error: toolchain 'bogus' is not installed\n"));
});
}

0 comments on commit ded5ee2

Please sign in to comment.