Skip to content

Commit

Permalink
Ignore inability to list targets in 'show'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
inejge committed Jul 28, 2016
1 parent 7f311dd commit 742e471
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![]
};
Expand Down

0 comments on commit 742e471

Please sign in to comment.