@@ -24,12 +24,12 @@ use rustc_span::source_map::FileLoader;
24
24
use rustc_span:: symbol:: { sym, Symbol } ;
25
25
use std:: env;
26
26
use std:: env:: consts:: { DLL_PREFIX , DLL_SUFFIX } ;
27
- use std:: lazy:: SyncOnceCell ;
28
27
use std:: mem;
29
28
#[ cfg( not( parallel_compiler) ) ]
30
29
use std:: panic;
31
30
use std:: path:: { Path , PathBuf } ;
32
31
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
32
+ use std:: sync:: OnceLock ;
33
33
use std:: thread;
34
34
use tracing:: info;
35
35
@@ -242,7 +242,7 @@ pub fn get_codegen_backend(
242
242
maybe_sysroot : & Option < PathBuf > ,
243
243
backend_name : Option < & str > ,
244
244
) -> 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 ( ) ;
246
246
247
247
let load = LOAD . get_or_init ( || {
248
248
let default_codegen_backend = option_env ! ( "CFG_DEFAULT_CODEGEN_BACKEND" ) . unwrap_or ( "llvm" ) ;
@@ -265,7 +265,7 @@ pub fn get_codegen_backend(
265
265
// loading, so we leave the code here. It is potentially useful for other tools
266
266
// that want to invoke the rustc binary while linking to rustc as well.
267
267
pub 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 ( ) ;
269
269
270
270
const BIN_PATH : & str = env ! ( "RUSTC_INSTALL_BINDIR" ) ;
271
271
0 commit comments