From 645f2d9778b8f133e112d138e565007c275aa7fe Mon Sep 17 00:00:00 2001 From: topecongiro Date: Thu, 23 Mar 2017 11:55:32 +0900 Subject: [PATCH] Use correct name for undefined linked toolchain invocation Closes #927. --- src/rustup-cli/job.rs | 1 - src/rustup/toolchain.rs | 2 +- tests/cli-exact.rs | 11 +++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rustup-cli/job.rs b/src/rustup-cli/job.rs index 0c2f85d422..fb11936493 100644 --- a/src/rustup-cli/job.rs +++ b/src/rustup-cli/job.rs @@ -156,7 +156,6 @@ mod imp { let mut killed = false; let list = &jobs.list[..jobs.header.NumberOfProcessIdsInList as usize]; assert!(list.len() > 0); - info!("found {} remaining processes", list.len() - 1); let list = list.iter().filter(|&&id| { // let's not kill ourselves diff --git a/src/rustup/toolchain.rs b/src/rustup/toolchain.rs index 51f25ba4a1..dc29c32961 100644 --- a/src/rustup/toolchain.rs +++ b/src/rustup/toolchain.rs @@ -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)); diff --git a/tests/cli-exact.rs b/tests/cli-exact.rs index 2e24e6e883..e7d867b986 100644 --- a/tests/cli-exact.rs +++ b/tests/cli-exact.rs @@ -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")); + }); +}