diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index b7e450cf1f..4ccda4678a 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -1045,8 +1045,11 @@ fn show(cfg: &Cfg<'_>, verbose: bool) -> Result { &active_reason, )?; writeln!(t.lock(), "name: {}", active_toolchain.name())?; - writeln!(t.lock(), "compiler: {}", active_toolchain.rustc_version())?; writeln!(t.lock(), "active because: {}", active_reason)?; + if verbose { + writeln!(t.lock(), "compiler: {}", active_toolchain.rustc_version())?; + writeln!(t.lock(), "path: {}", active_toolchain.path().display())?; + } // show installed targets for the active toolchain writeln!(t.lock(), "installed targets:")?; diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 33a05efe70..951e7fd66e 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -661,7 +661,6 @@ nightly-{0} (active, default) active toolchain ---------------- name: nightly-{0} -compiler: 1.3.0 (hash-nightly-2) active because: it's the default toolchain installed targets: {0} @@ -735,7 +734,6 @@ nightly-{0} (active, default) active toolchain ---------------- name: nightly-{0} -compiler: 1.3.0 (hash-nightly-2) active because: it's the default toolchain installed targets: {0} @@ -774,7 +772,6 @@ nightly-{0} (active, default) active toolchain ---------------- name: nightly-{0} -compiler: 1.3.0 (xxxx-nightly-2) active because: it's the default toolchain installed targets: {1} @@ -831,7 +828,6 @@ nightly-{0} (active, default) active toolchain ---------------- name: nightly-{0} -compiler: 1.3.0 (xxxx-nightly-2) active because: it's the default toolchain installed targets: {1} @@ -1139,7 +1135,6 @@ nightly-{0} (active, default) active toolchain ---------------- name: nightly-{0} -compiler: 1.3.0 (hash-nightly-2) active because: overridden by environment variable RUSTUP_TOOLCHAIN installed targets: {0} @@ -1227,11 +1222,17 @@ nightly-2015-01-01-{0} active toolchain ---------------- name: nightly-{0} -compiler: 1.3.0 (hash-nightly-2) active because: it's the default toolchain +compiler: 1.3.0 (hash-nightly-2) +path: {2} installed targets: {0} -" +", + config + .rustupdir + .join("toolchains") + .join(for_host!("nightly-{0}")) + .display() ), r"", )