From 57ee79217a916b92fcce0457f1b14936c20a7256 Mon Sep 17 00:00:00 2001 From: rami3l Date: Thu, 15 Jan 2026 23:23:13 +0100 Subject: [PATCH] fix(cli/rustup-mode): `check` for self updates for `SelfUpdateMode::CheckOnly` --- src/cli/rustup_mode.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 7518642759..46b73a534e 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -914,10 +914,13 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result { let self_update_mode = SelfUpdateMode::from_cfg(cfg)?; // Priority: no-self-update feature > self_update_mode > no-self-update args. // Check for update only if rustup does **not** have the no-self-update feature, - // and auto-self-update is configured to **enable** + // and auto-self-update is configured to **enable** or **check-only** // and has **no** no-self-update parameter. let self_update = !cfg!(feature = "no-self-update") - && self_update_mode == SelfUpdateMode::Enable + && matches!( + self_update_mode, + SelfUpdateMode::Enable | SelfUpdateMode::CheckOnly + ) && !opts.no_self_update; if self_update && check_rustup_update(&DownloadCfg::new(cfg)).await? {