@@ -24,12 +24,12 @@ use rustc_span::source_map::FileLoader;
2424use rustc_span:: symbol:: { sym, Symbol } ;
2525use std:: env;
2626use std:: env:: consts:: { DLL_PREFIX , DLL_SUFFIX } ;
27- use std:: lazy:: SyncOnceCell ;
2827use std:: mem;
2928#[ cfg( not( parallel_compiler) ) ]
3029use std:: panic;
3130use std:: path:: { Path , PathBuf } ;
3231use std:: sync:: atomic:: { AtomicBool , Ordering } ;
32+ use std:: sync:: OnceLock ;
3333use std:: thread;
3434use tracing:: info;
3535
@@ -242,7 +242,7 @@ pub fn get_codegen_backend(
242242 maybe_sysroot : & Option < PathBuf > ,
243243 backend_name : Option < & str > ,
244244) -> Box < dyn CodegenBackend > {
245- static LOAD : SyncOnceCell < unsafe fn ( ) -> Box < dyn CodegenBackend > > = SyncOnceCell :: new ( ) ;
245+ static LOAD : OnceLock < unsafe fn ( ) -> Box < dyn CodegenBackend > > = OnceLock :: new ( ) ;
246246
247247 let load = LOAD . get_or_init ( || {
248248 let default_codegen_backend = option_env ! ( "CFG_DEFAULT_CODEGEN_BACKEND" ) . unwrap_or ( "llvm" ) ;
@@ -265,7 +265,7 @@ pub fn get_codegen_backend(
265265// loading, so we leave the code here. It is potentially useful for other tools
266266// that want to invoke the rustc binary while linking to rustc as well.
267267pub fn rustc_path < ' a > ( ) -> Option < & ' a Path > {
268- static RUSTC_PATH : SyncOnceCell < Option < PathBuf > > = SyncOnceCell :: new ( ) ;
268+ static RUSTC_PATH : OnceLock < Option < PathBuf > > = OnceLock :: new ( ) ;
269269
270270 const BIN_PATH : & str = env ! ( "RUSTC_INSTALL_BINDIR" ) ;
271271
0 commit comments