@@ -20,6 +20,7 @@ use std::path::{Path, PathBuf};
20
20
use std:: pin:: Pin ;
21
21
use std:: process:: { self , Command } ;
22
22
use std:: str;
23
+ use std:: sync:: LazyLock ;
23
24
24
25
pub mod bencher;
25
26
mod etw_parser;
@@ -366,44 +367,42 @@ impl<'a> CargoProcess<'a> {
366
367
}
367
368
}
368
369
369
- lazy_static:: lazy_static! {
370
- static ref FAKE_RUSTC : PathBuf = {
371
- let mut fake_rustc = env:: current_exe( ) . unwrap( ) ;
372
- fake_rustc. pop( ) ;
373
- fake_rustc. push( "rustc-fake" ) ;
374
- fake_rustc
375
- } ;
376
- static ref FAKE_RUSTDOC : PathBuf = {
377
- let mut fake_rustdoc = env:: current_exe( ) . unwrap( ) ;
378
- fake_rustdoc. pop( ) ;
379
- fake_rustdoc. push( "rustdoc-fake" ) ;
380
- // link from rustc-fake to rustdoc-fake
381
- if !fake_rustdoc. exists( ) {
382
- #[ cfg( unix) ]
383
- use std:: os:: unix:: fs:: symlink;
384
- #[ cfg( windows) ]
385
- use std:: os:: windows:: fs:: symlink_file as symlink;
386
-
387
- symlink( & * FAKE_RUSTC , & fake_rustdoc) . expect( "failed to make symbolic link" ) ;
388
- }
389
- fake_rustdoc
390
- } ;
391
- static ref FAKE_CLIPPY : PathBuf = {
392
- let mut fake_clippy = env:: current_exe( ) . unwrap( ) ;
393
- fake_clippy. pop( ) ;
394
- fake_clippy. push( "clippy-fake" ) ;
395
- // link from rustc-fake to rustdoc-fake
396
- if !fake_clippy. exists( ) {
397
- #[ cfg( unix) ]
398
- use std:: os:: unix:: fs:: symlink;
399
- #[ cfg( windows) ]
400
- use std:: os:: windows:: fs:: symlink_file as symlink;
401
-
402
- symlink( & * FAKE_RUSTC , & fake_clippy) . expect( "failed to make symbolic link" ) ;
403
- }
404
- fake_clippy
405
- } ;
406
- }
370
+ static FAKE_RUSTC : LazyLock < PathBuf > = LazyLock :: new ( || {
371
+ let mut fake_rustc = env:: current_exe ( ) . unwrap ( ) ;
372
+ fake_rustc. pop ( ) ;
373
+ fake_rustc. push ( "rustc-fake" ) ;
374
+ fake_rustc
375
+ } ) ;
376
+ static FAKE_RUSTDOC : LazyLock < PathBuf > = LazyLock :: new ( || {
377
+ let mut fake_rustdoc = env:: current_exe ( ) . unwrap ( ) ;
378
+ fake_rustdoc. pop ( ) ;
379
+ fake_rustdoc. push ( "rustdoc-fake" ) ;
380
+ // link from rustc-fake to rustdoc-fake
381
+ if !fake_rustdoc. exists ( ) {
382
+ #[ cfg( unix) ]
383
+ use std:: os:: unix:: fs:: symlink;
384
+ #[ cfg( windows) ]
385
+ use std:: os:: windows:: fs:: symlink_file as symlink;
386
+
387
+ symlink ( & * FAKE_RUSTC , & fake_rustdoc) . expect ( "failed to make symbolic link" ) ;
388
+ }
389
+ fake_rustdoc
390
+ } ) ;
391
+ static FAKE_CLIPPY : LazyLock < PathBuf > = LazyLock :: new ( || {
392
+ let mut fake_clippy = env:: current_exe ( ) . unwrap ( ) ;
393
+ fake_clippy. pop ( ) ;
394
+ fake_clippy. push ( "clippy-fake" ) ;
395
+ // link from rustc-fake to rustdoc-fake
396
+ if !fake_clippy. exists ( ) {
397
+ #[ cfg( unix) ]
398
+ use std:: os:: unix:: fs:: symlink;
399
+ #[ cfg( windows) ]
400
+ use std:: os:: windows:: fs:: symlink_file as symlink;
401
+
402
+ symlink ( & * FAKE_RUSTC , & fake_clippy) . expect ( "failed to make symbolic link" ) ;
403
+ }
404
+ fake_clippy
405
+ } ) ;
407
406
408
407
/// Used to indicate if we need to retry a run.
409
408
pub enum Retry {
0 commit comments