@@ -107,8 +107,8 @@ impl Std {
107107 ) -> Vec < ( PathBuf , DependencyType ) > {
108108 let mut deps = Vec :: new ( ) ;
109109 if !self . is_for_mir_opt_tests {
110- deps. extend ( copy_third_party_objects ( builder, & compiler, target) ) ;
111- deps. extend ( copy_self_contained_objects ( builder, & compiler, target) ) ;
110+ deps. extend ( copy_third_party_objects ( builder, compiler, target) ) ;
111+ deps. extend ( copy_self_contained_objects ( builder, compiler, target) ) ;
112112 }
113113 deps
114114 }
@@ -186,7 +186,7 @@ impl Step for Std {
186186
187187 // Profiler information requires LLVM's compiler-rt
188188 if builder. config . profiler {
189- builder. update_submodule ( & Path :: new ( "src/llvm-project" ) ) ;
189+ builder. update_submodule ( Path :: new ( "src/llvm-project" ) ) ;
190190 }
191191
192192 let mut target_deps = builder. ensure ( StartupObjects { compiler, target } ) ;
@@ -271,7 +271,7 @@ impl Step for Std {
271271 if target. is_synthetic ( ) {
272272 cargo. env ( "RUSTC_BOOTSTRAP_SYNTHETIC_TARGET" , "1" ) ;
273273 }
274- for rustflag in self . extra_rust_args . into_iter ( ) {
274+ for rustflag in self . extra_rust_args . iter ( ) {
275275 cargo. rustflag ( rustflag) ;
276276 }
277277
@@ -333,7 +333,7 @@ fn copy_third_party_objects(
333333 // The sanitizers are only copied in stage1 or above,
334334 // to avoid creating dependency on LLVM.
335335 target_deps. extend (
336- copy_sanitizers ( builder, & compiler, target)
336+ copy_sanitizers ( builder, compiler, target)
337337 . into_iter ( )
338338 . map ( |d| ( d, DependencyType :: Target ) ) ,
339339 ) ;
@@ -487,7 +487,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
487487
488488 // for no-std targets we only compile a few no_std crates
489489 cargo
490- . args ( & [ "-p" , "alloc" ] )
490+ . args ( [ "-p" , "alloc" ] )
491491 . arg ( "--manifest-path" )
492492 . arg ( builder. src . join ( "library/alloc/Cargo.toml" ) )
493493 . arg ( "--features" )
@@ -626,20 +626,20 @@ impl Step for StdLink {
626626 . build
627627 . config
628628 . initial_rustc
629- . starts_with ( builder. out . join ( & compiler. host . triple ) . join ( "stage0/bin" ) )
629+ . starts_with ( builder. out . join ( compiler. host . triple ) . join ( "stage0/bin" ) )
630630 {
631631 // Copy bin files from stage0/bin to stage0-sysroot/bin
632- let sysroot = builder. out . join ( & compiler. host . triple ) . join ( "stage0-sysroot" ) ;
632+ let sysroot = builder. out . join ( compiler. host . triple ) . join ( "stage0-sysroot" ) ;
633633
634634 let host = compiler. host . triple ;
635- let stage0_bin_dir = builder. out . join ( & host) . join ( "stage0/bin" ) ;
635+ let stage0_bin_dir = builder. out . join ( host) . join ( "stage0/bin" ) ;
636636 let sysroot_bin_dir = sysroot. join ( "bin" ) ;
637637 t ! ( fs:: create_dir_all( & sysroot_bin_dir) ) ;
638638 builder. cp_r ( & stage0_bin_dir, & sysroot_bin_dir) ;
639639
640640 // Copy all *.so files from stage0/lib to stage0-sysroot/lib
641- let stage0_lib_dir = builder. out . join ( & host) . join ( "stage0/lib" ) ;
642- if let Ok ( files) = fs:: read_dir ( & stage0_lib_dir) {
641+ let stage0_lib_dir = builder. out . join ( host) . join ( "stage0/lib" ) ;
642+ if let Ok ( files) = fs:: read_dir ( stage0_lib_dir) {
643643 for file in files {
644644 let file = t ! ( file) ;
645645 let path = file. path ( ) ;
@@ -654,9 +654,9 @@ impl Step for StdLink {
654654 t ! ( fs:: create_dir_all( & sysroot_codegen_backends) ) ;
655655 let stage0_codegen_backends = builder
656656 . out
657- . join ( & host)
657+ . join ( host)
658658 . join ( "stage0/lib/rustlib" )
659- . join ( & host)
659+ . join ( host)
660660 . join ( "codegen-backends" ) ;
661661 if stage0_codegen_backends. exists ( ) {
662662 builder. cp_r ( & stage0_codegen_backends, & sysroot_codegen_backends) ;
@@ -1179,7 +1179,7 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
11791179 // The config can also specify its own llvm linker flags.
11801180 if let Some ( ref s) = builder. config . llvm_ldflags {
11811181 if !llvm_linker_flags. is_empty ( ) {
1182- llvm_linker_flags. push_str ( " " ) ;
1182+ llvm_linker_flags. push ( ' ' ) ;
11831183 }
11841184 llvm_linker_flags. push_str ( s) ;
11851185 }
@@ -1270,7 +1270,7 @@ fn needs_codegen_config(run: &RunConfig<'_>) -> bool {
12701270 for path_set in & run. paths {
12711271 needs_codegen_cfg = match path_set {
12721272 PathSet :: Set ( set) => set. iter ( ) . any ( |p| is_codegen_cfg_needed ( p, run) ) ,
1273- PathSet :: Suite ( suite) => is_codegen_cfg_needed ( & suite, run) ,
1273+ PathSet :: Suite ( suite) => is_codegen_cfg_needed ( suite, run) ,
12741274 }
12751275 }
12761276 needs_codegen_cfg
@@ -1279,7 +1279,7 @@ fn needs_codegen_config(run: &RunConfig<'_>) -> bool {
12791279pub ( crate ) const CODEGEN_BACKEND_PREFIX : & str = "rustc_codegen_" ;
12801280
12811281fn is_codegen_cfg_needed ( path : & TaskPath , run : & RunConfig < ' _ > ) -> bool {
1282- if path. path . to_str ( ) . unwrap ( ) . contains ( & CODEGEN_BACKEND_PREFIX ) {
1282+ if path. path . to_str ( ) . unwrap ( ) . contains ( CODEGEN_BACKEND_PREFIX ) {
12831283 let mut needs_codegen_backend_config = true ;
12841284 for & backend in run. builder . config . codegen_backends ( run. target ) {
12851285 if path
@@ -1300,7 +1300,7 @@ fn is_codegen_cfg_needed(path: &TaskPath, run: &RunConfig<'_>) -> bool {
13001300 }
13011301 }
13021302
1303- return false ;
1303+ false
13041304}
13051305
13061306impl Step for CodegenBackend {
@@ -1393,7 +1393,7 @@ impl Step for CodegenBackend {
13931393 }
13941394 let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
13951395 let codegen_backend = codegen_backend. to_str ( ) . unwrap ( ) ;
1396- t ! ( fs:: write( & stamp, & codegen_backend) ) ;
1396+ t ! ( fs:: write( stamp, codegen_backend) ) ;
13971397 }
13981398}
13991399
@@ -1441,7 +1441,7 @@ fn copy_codegen_backends_to_sysroot(
14411441 let dot = filename. find ( '.' ) . unwrap ( ) ;
14421442 format ! ( "{}-{}{}" , & filename[ ..dash] , builder. rust_release( ) , & filename[ dot..] )
14431443 } ;
1444- builder. copy ( & file, & dst. join ( target_filename) ) ;
1444+ builder. copy ( file, & dst. join ( target_filename) ) ;
14451445 }
14461446}
14471447
@@ -1519,7 +1519,7 @@ impl Step for Sysroot {
15191519 /// 1-3.
15201520 fn run ( self , builder : & Builder < ' _ > ) -> Interned < PathBuf > {
15211521 let compiler = self . compiler ;
1522- let host_dir = builder. out . join ( & compiler. host . triple ) ;
1522+ let host_dir = builder. out . join ( compiler. host . triple ) ;
15231523
15241524 let sysroot_dir = |stage| {
15251525 if stage == 0 {
@@ -1578,7 +1578,7 @@ impl Step for Sysroot {
15781578 let mut add_filtered_files = |suffix, contents| {
15791579 for path in contents {
15801580 let path = Path :: new ( & path) ;
1581- if path. parent ( ) . map_or ( false , |parent| parent. ends_with ( & suffix) ) {
1581+ if path. parent ( ) . map_or ( false , |parent| parent. ends_with ( suffix) ) {
15821582 filtered_files. push ( path. file_name ( ) . unwrap ( ) . to_owned ( ) ) ;
15831583 }
15841584 }
@@ -1802,7 +1802,7 @@ impl Step for Assemble {
18021802 if let Some ( lld_install) = lld_install {
18031803 let src_exe = exe ( "lld" , target_compiler. host ) ;
18041804 let dst_exe = exe ( "rust-lld" , target_compiler. host ) ;
1805- builder. copy ( & lld_install. join ( "bin" ) . join ( & src_exe) , & libdir_bin. join ( & dst_exe) ) ;
1805+ builder. copy ( & lld_install. join ( "bin" ) . join ( src_exe) , & libdir_bin. join ( dst_exe) ) ;
18061806 let self_contained_lld_dir = libdir_bin. join ( "gcc-ld" ) ;
18071807 t ! ( fs:: create_dir_all( & self_contained_lld_dir) ) ;
18081808 let lld_wrapper_exe = builder. ensure ( crate :: core:: build_steps:: tool:: LldWrapper {
@@ -1850,7 +1850,7 @@ impl Step for Assemble {
18501850 let out_dir = builder. cargo_out ( build_compiler, Mode :: Rustc , host) ;
18511851 let rustc = out_dir. join ( exe ( "rustc-main" , host) ) ;
18521852 let bindir = sysroot. join ( "bin" ) ;
1853- t ! ( fs:: create_dir_all( & bindir) ) ;
1853+ t ! ( fs:: create_dir_all( bindir) ) ;
18541854 let compiler = builder. rustc ( target_compiler) ;
18551855 builder. copy ( & rustc, & compiler) ;
18561856
@@ -1869,9 +1869,9 @@ pub fn add_to_sysroot(
18691869 stamp : & Path ,
18701870) {
18711871 let self_contained_dst = & sysroot_dst. join ( "self-contained" ) ;
1872- t ! ( fs:: create_dir_all( & sysroot_dst) ) ;
1873- t ! ( fs:: create_dir_all( & sysroot_host_dst) ) ;
1874- t ! ( fs:: create_dir_all( & self_contained_dst) ) ;
1872+ t ! ( fs:: create_dir_all( sysroot_dst) ) ;
1873+ t ! ( fs:: create_dir_all( sysroot_host_dst) ) ;
1874+ t ! ( fs:: create_dir_all( self_contained_dst) ) ;
18751875 for ( path, dependency_type) in builder. read_stamp_file ( stamp) {
18761876 let dst = match dependency_type {
18771877 DependencyType :: Host => sysroot_host_dst,
@@ -2009,14 +2009,14 @@ pub fn run_cargo(
20092009 . map ( |e| ( e. path ( ) , e. file_name ( ) . into_string ( ) . unwrap ( ) , t ! ( e. metadata( ) ) ) )
20102010 . collect :: < Vec < _ > > ( ) ;
20112011 for ( prefix, extension, expected_len) in toplevel {
2012- let candidates = contents. iter ( ) . filter ( |& & ( _, ref filename, ref meta) | {
2012+ let candidates = contents. iter ( ) . filter ( |& ( _, filename, meta) | {
20132013 meta. len ( ) == expected_len
20142014 && filename
20152015 . strip_prefix ( & prefix[ ..] )
20162016 . map ( |s| s. starts_with ( '-' ) && s. ends_with ( & extension[ ..] ) )
20172017 . unwrap_or ( false )
20182018 } ) ;
2019- let max = candidates. max_by_key ( |& & ( _, _, ref metadata) | {
2019+ let max = candidates. max_by_key ( |& ( _, _, metadata) | {
20202020 metadata. modified ( ) . expect ( "mtime should be available on all relevant OSes" )
20212021 } ) ;
20222022 let path_to_add = match max {
@@ -2045,7 +2045,7 @@ pub fn run_cargo(
20452045 new_contents. extend ( dep. to_str ( ) . unwrap ( ) . as_bytes ( ) ) ;
20462046 new_contents. extend ( b"\0 " ) ;
20472047 }
2048- t ! ( fs:: write( & stamp, & new_contents) ) ;
2048+ t ! ( fs:: write( stamp, & new_contents) ) ;
20492049 deps. into_iter ( ) . map ( |( d, _) | d) . collect ( )
20502050}
20512051
0 commit comments