@@ -899,7 +899,7 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result<utils::ExitCode
899
899
// Check for update only if rustup does **not** have the no-self-update feature,
900
900
// and auto-self-update is configured to **enable**
901
901
// and has **no** no-self-update parameter.
902
- let self_update = !self_update :: NEVER_SELF_UPDATE
902
+ let self_update = !cfg ! ( feature = "no-self-update" )
903
903
&& self_update_mode == SelfUpdateMode :: Enable
904
904
&& !opts. no_self_update ;
905
905
@@ -924,7 +924,7 @@ async fn update(
924
924
// Update only if rustup does **not** have the no-self-update feature,
925
925
// and auto-self-update is configured to **enable**
926
926
// and has **no** no-self-update parameter.
927
- let self_update = !self_update :: NEVER_SELF_UPDATE
927
+ let self_update = !cfg ! ( feature = "no-self-update" )
928
928
&& self_update_mode == SelfUpdateMode :: Enable
929
929
&& !opts. no_self_update ;
930
930
let force_non_host = opts. force_non_host ;
@@ -1001,11 +1001,11 @@ async fn update(
1001
1001
cfg. tmp_cx . clean ( ) ;
1002
1002
}
1003
1003
1004
- if !self_update :: NEVER_SELF_UPDATE && self_update_mode == SelfUpdateMode :: CheckOnly {
1004
+ if !cfg ! ( feature = "no-self-update" ) && self_update_mode == SelfUpdateMode :: CheckOnly {
1005
1005
check_rustup_update ( cfg. process ) . await ?;
1006
1006
}
1007
1007
1008
- if self_update :: NEVER_SELF_UPDATE {
1008
+ if cfg ! ( feature = "no-self-update" ) {
1009
1009
info ! ( "self-update is disabled for this build of rustup" ) ;
1010
1010
info ! ( "any updates to rustup will need to be fetched with your system package manager" )
1011
1011
}
@@ -1778,7 +1778,7 @@ fn set_auto_self_update(
1778
1778
cfg : & mut Cfg < ' _ > ,
1779
1779
auto_self_update_mode : SelfUpdateMode ,
1780
1780
) -> Result < utils:: ExitCode > {
1781
- if self_update :: NEVER_SELF_UPDATE {
1781
+ if cfg ! ( feature = "no-self-update" ) {
1782
1782
let mut args = cfg. process . args_os ( ) ;
1783
1783
let arg0 = args. next ( ) . map ( PathBuf :: from) ;
1784
1784
let arg0 = arg0
0 commit comments