Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,10 +914,13 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result<ExitCode> {
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? {
Expand Down