@@ -20,6 +20,7 @@ use std::path::{Path, PathBuf};
2020use std:: pin:: Pin ;
2121use std:: process:: { self , Command } ;
2222use std:: str;
23+ use std:: sync:: LazyLock ;
2324
2425pub mod bencher;
2526mod etw_parser;
@@ -366,44 +367,42 @@ impl<'a> CargoProcess<'a> {
366367 }
367368}
368369
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+ } ) ;
407406
408407/// Used to indicate if we need to retry a run.
409408pub enum Retry {
0 commit comments