Skip to content

Commit c89f131

Browse files
CLoaKY233rami3l
authored andcommitted
show toolchain paths in rustup show -v output
1 parent 6261788 commit c89f131

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/cli/rustup_mode.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,6 @@ async fn show(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode> {
10071007
print_header::<Error>(&mut t, "installed toolchains")?;
10081008

10091009
let default_toolchain_name = cfg.get_default()?;
1010-
10111010
let last_index = installed_toolchains.len().wrapping_sub(1);
10121011
for (n, toolchain_name) in installed_toolchains.into_iter().enumerate() {
10131012
let is_default_toolchain = default_toolchain_name.as_ref() == Some(&toolchain_name);
@@ -1026,11 +1025,10 @@ async fn show(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode> {
10261025
let toolchain = Toolchain::new(cfg, toolchain_name.into())?;
10271026
writeln!(
10281027
cfg.process.stdout().lock(),
1029-
" {}",
1030-
toolchain.rustc_version()
1028+
" {}\n path: {}",
1029+
toolchain.rustc_version(),
1030+
toolchain.path().display()
10311031
)?;
1032-
// To make it easy to see which rustc belongs to which
1033-
// toolchain, we separate each pair with an extra newline.
10341032
if n != last_index {
10351033
writeln!(cfg.process.stdout().lock())?;
10361034
}

tests/suite/cli_rustup.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,11 @@ installed toolchains
11971197
--------------------
11981198
nightly-{0} (active, default)
11991199
1.3.0 (hash-nightly-2)
1200+
path: {2}
12001201
12011202
nightly-2015-01-01-{0}
12021203
1.2.0 (hash-nightly-1)
1204+
path: {3}
12031205
12041206
active toolchain
12051207
----------------
@@ -1214,6 +1216,11 @@ installed targets:
12141216
.rustupdir
12151217
.join("toolchains")
12161218
.join(for_host!("nightly-{0}"))
1219+
.display(),
1220+
config
1221+
.rustupdir
1222+
.join("toolchains")
1223+
.join(for_host!("nightly-2015-01-01-{0}"))
12171224
.display()
12181225
),
12191226
r"",

0 commit comments

Comments
 (0)