Skip to content

Commit

Permalink
feat(cli): show the toolchain path with `rustup show active-toolchain…
Browse files Browse the repository at this point in the history
… --verbose`
  • Loading branch information
rami3l committed Dec 30, 2024
1 parent 7efb4bd commit 1fe9366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,9 @@ fn show_active_toolchain(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode
if verbose {
writeln!(
cfg.process.stdout().lock(),
"compiler: {}",
toolchain.rustc_version()
"compiler: {}\npath: {}",
toolchain.rustc_version(),
toolchain.path().display(),
)?;
}
}
Expand Down
8 changes: 7 additions & 1 deletion tests/suite/cli_rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,13 @@ async fn show_active_toolchain_with_verbose() {
r"nightly-{0}
active because: it's the default toolchain
compiler: 1.3.0 (hash-nightly-2)
"
path: {1}
",
cx.config
.rustupdir
.join("toolchains")
.join(for_host!("nightly-{0}"))
.display()
),
r"",
)
Expand Down

0 comments on commit 1fe9366

Please sign in to comment.