about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-30 08:32:54 +0000
committerbors <bors@rust-lang.org>2022-06-30 08:32:54 +0000
commit0cb0f7636851f9fcc57085cf80197a2ef6db098f (patch)
treee614515446be6457d225800d863c6d34f3d51908 /src
parentff3964af1b497f5621f9c1e362cef24aeab4018a (diff)
parent9de1f9f45a85c452ea0371080687e0251f1395c1 (diff)
downloadrust-0cb0f7636851f9fcc57085cf80197a2ef6db098f.tar.gz
rust-0cb0f7636851f9fcc57085cf80197a2ef6db098f.zip
Auto merge of #9069 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
Diffstat (limited to 'src')
-rw-r--r--src/driver.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/driver.rs b/src/driver.rs
index 88991b340b1..96d542cfe10 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -21,11 +21,11 @@ use rustc_tools_util::VersionInfo;
 
 use std::borrow::Cow;
 use std::env;
-use std::lazy::SyncLazy;
 use std::ops::Deref;
 use std::panic;
 use std::path::{Path, PathBuf};
 use std::process::{exit, Command};
+use std::sync::LazyLock;
 
 /// If a command-line option matches `find_arg`, then apply the predicate `pred` on its value. If
 /// true, then return it. The parameter is assumed to be either `--arg=value` or `--arg value`.
@@ -153,7 +153,8 @@ You can use tool lints to allow or deny lints from your code, eg.:
 
 const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rust-clippy/issues/new";
 
-static ICE_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> = SyncLazy::new(|| {
+type PanicCallback = dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static;
+static ICE_HOOK: LazyLock<Box<PanicCallback>> = LazyLock::new(|| {
     let hook = panic::take_hook();
     panic::set_hook(Box::new(|info| report_clippy_ice(info, BUG_REPORT_URL)));
     hook
@@ -220,7 +221,7 @@ fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<Pat
 #[allow(clippy::too_many_lines)]
 pub fn main() {
     rustc_driver::init_rustc_env_logger();
-    SyncLazy::force(&ICE_HOOK);
+    LazyLock::force(&ICE_HOOK);
     exit(rustc_driver::catch_with_exit_code(move || {
         let mut orig_args: Vec<String> = env::args().collect();