@@ -895,7 +895,7 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result<utils::ExitCode
895
895
// Check for update only if rustup does **not** have the no-self-update feature,
896
896
// and auto-self-update is configured to **enable**
897
897
// and has **no** no-self-update parameter.
898
- let self_update = !self_update :: NEVER_SELF_UPDATE
898
+ let self_update = !cfg ! ( feature = "no-self-update" )
899
899
&& self_update_mode == SelfUpdateMode :: Enable
900
900
&& !opts. no_self_update ;
901
901
@@ -920,7 +920,7 @@ async fn update(
920
920
// Update only if rustup does **not** have the no-self-update feature,
921
921
// and auto-self-update is configured to **enable**
922
922
// and has **no** no-self-update parameter.
923
- let self_update = !self_update :: NEVER_SELF_UPDATE
923
+ let self_update = !cfg ! ( feature = "no-self-update" )
924
924
&& self_update_mode == SelfUpdateMode :: Enable
925
925
&& !opts. no_self_update ;
926
926
let force_non_host = opts. force_non_host ;
@@ -997,11 +997,11 @@ async fn update(
997
997
cfg. tmp_cx . clean ( ) ;
998
998
}
999
999
1000
- if !self_update :: NEVER_SELF_UPDATE && self_update_mode == SelfUpdateMode :: CheckOnly {
1000
+ if !cfg ! ( feature = "no-self-update" ) && self_update_mode == SelfUpdateMode :: CheckOnly {
1001
1001
check_rustup_update ( cfg. process ) . await ?;
1002
1002
}
1003
1003
1004
- if self_update :: NEVER_SELF_UPDATE {
1004
+ if cfg ! ( feature = "no-self-update" ) {
1005
1005
info ! ( "self-update is disabled for this build of rustup" ) ;
1006
1006
info ! ( "any updates to rustup will need to be fetched with your system package manager" )
1007
1007
}
@@ -1774,7 +1774,7 @@ fn set_auto_self_update(
1774
1774
cfg : & mut Cfg < ' _ > ,
1775
1775
auto_self_update_mode : SelfUpdateMode ,
1776
1776
) -> Result < utils:: ExitCode > {
1777
- if self_update :: NEVER_SELF_UPDATE {
1777
+ if cfg ! ( feature = "no-self-update" ) {
1778
1778
let mut args = cfg. process . args_os ( ) ;
1779
1779
let arg0 = args. next ( ) . map ( PathBuf :: from) ;
1780
1780
let arg0 = arg0
0 commit comments