X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Fconfig.rs;h=babf09d2b93349605ed3c8b2965635e7932a352b;hb=2aa7f54df20938918cd188e306df92bd9b8637bf;hp=c61025b556aa5702941f43215aebc73144aaa59e;hpb=741f3cf38331d4644b89d52f54c2683c17f54670;p=rust.git diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index c61025b556a..babf09d2b93 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1511,19 +1511,25 @@ pub(crate) fn llvm_link_shared(&self) -> bool { /// Return whether we will use a downloaded, pre-compiled version of rustc, or just build from source. pub(crate) fn download_rustc(&self) -> bool { - static DOWNLOAD_RUSTC: OnceCell = OnceCell::new(); + self.download_rustc_commit().is_some() + } + + pub(crate) fn download_rustc_commit(&self) -> Option<&'static str> { + static DOWNLOAD_RUSTC: OnceCell> = OnceCell::new(); if self.dry_run() && DOWNLOAD_RUSTC.get().is_none() { // avoid trying to actually download the commit - return false; + return None; } - *DOWNLOAD_RUSTC.get_or_init(|| match &self.download_rustc_commit { - None => false, - Some(commit) => { - self.download_ci_rustc(commit); - true - } - }) + DOWNLOAD_RUSTC + .get_or_init(|| match &self.download_rustc_commit { + None => None, + Some(commit) => { + self.download_ci_rustc(commit); + Some(commit.clone()) + } + }) + .as_deref() } pub(crate) fn initial_rustfmt(&self) -> Option {