From 742e471392c05f5f392419e55045c350259e6fec Mon Sep 17 00:00:00 2001 From: Ivan Nejgebauer Date: Thu, 28 Jul 2016 21:41:51 +0200 Subject: [PATCH] Ignore inability to list targets in 'show' For an active custom toolchain, targets can't be listed because a custom toolchain doesn't support components. Normally, this error would terminate 'show', which is surprising, so we silently use an empty target list instead. --- src/rustup-cli/rustup_mode.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/rustup-cli/rustup_mode.rs b/src/rustup-cli/rustup_mode.rs index 44ab8526b0a..4413e9b58ee 100644 --- a/src/rustup-cli/rustup_mode.rs +++ b/src/rustup-cli/rustup_mode.rs @@ -444,11 +444,14 @@ fn show(cfg: &Cfg) -> Result<()> { let installed_toolchains = try!(cfg.list_toolchains()); let active_toolchain = try!(cfg.find_override_toolchain_or_default(cwd)); let active_targets = if let Some((ref t, _)) = active_toolchain { - try!(t.list_components()) - .into_iter() - .filter(|c| c.component.pkg == "rust-std") - .filter(|c| c.installed) - .collect() + match t.list_components() { + Ok(cs_vec) => cs_vec + .into_iter() + .filter(|c| c.component.pkg == "rust-std") + .filter(|c| c.installed) + .collect(), + Err(_) => vec![] + } } else { vec![] };