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? {