Skip to content

Commit d20aad5

Browse files
committed
notifications: log directly when using existing toolchains
1 parent 9860966 commit d20aad5

File tree

7 files changed

+9
-12
lines changed

7 files changed

+9
-12
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ impl<'a> Cfg<'a> {
837837
}
838838
Ok(mut distributable) => {
839839
if verbose {
840-
(self.notify_handler)(Notification::UsingExistingToolchain(toolchain));
840+
info!("using existing install for {toolchain}");
841841
}
842842
let status = if !distributable.components_exist(&components, &targets)? {
843843
distributable.update(&components, &targets, profile).await?

src/notifications.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
44
use crate::dist::TargetTriple;
55
use crate::settings::MetadataVersion;
66
use crate::utils::units;
7-
use crate::{dist::ToolchainDesc, toolchain::ToolchainName, utils::notify::NotificationLevel};
7+
use crate::{toolchain::ToolchainName, utils::notify::NotificationLevel};
88

99
#[derive(Debug)]
1010
pub(crate) enum Notification<'a> {
@@ -30,7 +30,6 @@ pub(crate) enum Notification<'a> {
3030
UpdatingToolchain(&'a str),
3131
InstallingToolchain(&'a str),
3232
InstalledToolchain(&'a str),
33-
UsingExistingToolchain(&'a ToolchainDesc),
3433
UninstallingToolchain(&'a ToolchainName),
3534
UninstalledToolchain(&'a ToolchainName),
3635
UpdateHashMatches,
@@ -63,8 +62,7 @@ impl Notification<'_> {
6362
| ReadMetadataVersion(_)
6463
| InstalledToolchain(_)
6564
| UpdateHashMatches => NotificationLevel::Debug,
66-
UsingExistingToolchain(_)
67-
| UninstallingToolchain(_)
65+
UninstallingToolchain(_)
6866
| UninstalledToolchain(_)
6967
| UpgradingMetadata(_, _)
7068
| MetadataUpgradeNotNeeded(_) => NotificationLevel::Info,
@@ -100,7 +98,6 @@ impl Display for Notification<'_> {
10098
UpdatingToolchain(name) => write!(f, "updating existing install for '{name}'"),
10199
InstallingToolchain(name) => write!(f, "installing toolchain '{name}'"),
102100
InstalledToolchain(name) => write!(f, "toolchain '{name}' installed"),
103-
UsingExistingToolchain(name) => write!(f, "using existing install for '{name}'"),
104101
UninstallingToolchain(name) => write!(f, "uninstalling toolchain '{name}'"),
105102
UninstalledToolchain(name) => write!(f, "toolchain '{name}' uninstalled"),
106103
UpdateHashMatches => write!(f, "toolchain is already up to date"),

tests/suite/cli_exact.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ async fn override_again() {
355355
.is_ok()
356356
.with_stdout(snapbox::str![[""]])
357357
.with_stderr(snapbox::str![[r#"
358-
info: override toolchain for '[CWD]' set to 'nightly-[HOST_TRIPLE]'
358+
info: override toolchain for [CWD] set to nightly-[HOST_TRIPLE]
359359
360360
"#]]);
361361
}

tests/suite/cli_misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ async fn toolchains_are_resolved_early() {
636636
.await
637637
.with_stderr(snapbox::str![[r#"
638638
...
639-
info: using existing install for 'nightly-[HOST_TRIPLE]'
639+
info: using existing install for nightly-[HOST_TRIPLE]
640640
...
641641
"#]])
642642
.is_ok();

tests/suite/cli_rustup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ async fn default_override() {
322322
.expect(["rustup", "default", "stable"])
323323
.await
324324
.with_stderr(snapbox::str![[r#"
325-
info: using existing install for 'stable-[HOST_TRIPLE]'
325+
info: using existing install for stable-[HOST_TRIPLE]
326326
info: default toolchain set to stable-[HOST_TRIPLE]
327327
info: note that the toolchain 'nightly-[HOST_TRIPLE]' is currently in use (directory override for '[..]')
328328
@@ -1729,7 +1729,7 @@ rustc-[HOST_TRIPLE]
17291729
.await
17301730
.extend_redactions([("[TOOLCHAIN_FILE]", &toolchain_file)])
17311731
.with_stderr(snapbox::str![[r#"
1732-
info: using existing install for 'nightly-[HOST_TRIPLE]'
1732+
info: using existing install for nightly-[HOST_TRIPLE]
17331733
info: the active toolchain `nightly-[HOST_TRIPLE]` has been installed
17341734
info: it's active because: overridden by '[TOOLCHAIN_FILE]'
17351735

tests/suite/cli_v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async fn default_existing_toolchain() {
147147
.await
148148
.with_stderr(snapbox::str![[r#"
149149
...
150-
info: using existing install for 'nightly-[HOST_TRIPLE]'
150+
info: using existing install for nightly-[HOST_TRIPLE]
151151
...
152152
"#]])
153153
.is_ok();

tests/suite/cli_v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async fn default_existing_toolchain() {
196196
.await
197197
.with_stderr(snapbox::str![[r#"
198198
...
199-
info: using existing install for 'nightly-[HOST_TRIPLE]'
199+
info: using existing install for nightly-[HOST_TRIPLE]
200200
...
201201
"#]])
202202
.is_ok();

0 commit comments

Comments
 (0)