@@ -834,7 +834,7 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result<utils::ExitCode
834
834
// Check for update only if rustup does **not** have the no-self-update feature,
835
835
// and auto-self-update is configured to **enable**
836
836
// and has **no** no-self-update parameter.
837
- let self_update = !self_update :: NEVER_SELF_UPDATE
837
+ let self_update = !cfg ! ( feature = "no-self-update" )
838
838
&& self_update_mode == SelfUpdateMode :: Enable
839
839
&& !opts. no_self_update ;
840
840
@@ -859,7 +859,7 @@ async fn update(
859
859
// Update only if rustup does **not** have the no-self-update feature,
860
860
// and auto-self-update is configured to **enable**
861
861
// and has **no** no-self-update parameter.
862
- let self_update = !self_update :: NEVER_SELF_UPDATE
862
+ let self_update = !cfg ! ( feature = "no-self-update" )
863
863
&& self_update_mode == SelfUpdateMode :: Enable
864
864
&& !opts. no_self_update ;
865
865
let force_non_host = opts. force_non_host ;
@@ -936,11 +936,11 @@ async fn update(
936
936
cfg. tmp_cx . clean ( ) ;
937
937
}
938
938
939
- if !self_update :: NEVER_SELF_UPDATE && self_update_mode == SelfUpdateMode :: CheckOnly {
939
+ if !cfg ! ( feature = "no-self-update" ) && self_update_mode == SelfUpdateMode :: CheckOnly {
940
940
check_rustup_update ( cfg. process ) . await ?;
941
941
}
942
942
943
- if self_update :: NEVER_SELF_UPDATE {
943
+ if cfg ! ( feature = "no-self-update" ) {
944
944
info ! ( "self-update is disabled for this build of rustup" ) ;
945
945
info ! ( "any updates to rustup will need to be fetched with your system package manager" )
946
946
}
@@ -1714,7 +1714,7 @@ fn set_auto_self_update(
1714
1714
cfg : & mut Cfg < ' _ > ,
1715
1715
auto_self_update_mode : SelfUpdateMode ,
1716
1716
) -> Result < utils:: ExitCode > {
1717
- if self_update :: NEVER_SELF_UPDATE {
1717
+ if cfg ! ( feature = "no-self-update" ) {
1718
1718
let mut args = cfg. process . args_os ( ) ;
1719
1719
let arg0 = args. next ( ) . map ( PathBuf :: from) ;
1720
1720
let arg0 = arg0
0 commit comments