@@ -275,12 +275,8 @@ fn make_win_dist(
275275    } 
276276
277277    //Copy platform tools to platform-specific bin directory 
278-     let  target_bin_dir = plat_root
279-         . join ( "lib" ) 
280-         . join ( "rustlib" ) 
281-         . join ( target. triple ) 
282-         . join ( "bin" ) 
283-         . join ( "self-contained" ) ; 
278+     let  target_bin_dir =
279+         plat_root. join ( "lib" ) . join ( "rustlib" ) . join ( target) . join ( "bin" ) . join ( "self-contained" ) ; 
284280    fs:: create_dir_all ( & target_bin_dir) . expect ( "creating target_bin_dir failed" ) ; 
285281    for  src in  target_tools { 
286282        builder. copy_link_to_folder ( & src,  & target_bin_dir) ; 
@@ -295,12 +291,8 @@ fn make_win_dist(
295291    ) ; 
296292
297293    //Copy platform libs to platform-specific lib directory 
298-     let  target_lib_dir = plat_root
299-         . join ( "lib" ) 
300-         . join ( "rustlib" ) 
301-         . join ( target. triple ) 
302-         . join ( "lib" ) 
303-         . join ( "self-contained" ) ; 
294+     let  target_lib_dir =
295+         plat_root. join ( "lib" ) . join ( "rustlib" ) . join ( target) . join ( "lib" ) . join ( "self-contained" ) ; 
304296    fs:: create_dir_all ( & target_lib_dir) . expect ( "creating target_lib_dir failed" ) ; 
305297    for  src in  target_libs { 
306298        builder. copy_link_to_folder ( & src,  & target_lib_dir) ; 
@@ -450,7 +442,7 @@ impl Step for Rustc {
450442            // component for now. 
451443            maybe_install_llvm_runtime ( builder,  host,  image) ; 
452444
453-             let  dst_dir = image. join ( "lib/rustlib" ) . join ( & * host. triple ) . join ( "bin" ) ; 
445+             let  dst_dir = image. join ( "lib/rustlib" ) . join ( host) . join ( "bin" ) ; 
454446            t ! ( fs:: create_dir_all( & dst_dir) ) ; 
455447
456448            // Copy over lld if it's there 
@@ -607,7 +599,7 @@ fn verify_uefi_rlib_format(builder: &Builder<'_>, target: TargetSelection, stamp
607599
608600/// Copy stamped files into an image's `target/lib` directory. 
609601fn  copy_target_libs ( builder :  & Builder < ' _ > ,  target :  TargetSelection ,  image :  & Path ,  stamp :  & Path )  { 
610-     let  dst = image. join ( "lib/rustlib" ) . join ( target. triple ) . join ( "lib" ) ; 
602+     let  dst = image. join ( "lib/rustlib" ) . join ( target) . join ( "lib" ) ; 
611603    let  self_contained_dst = dst. join ( "self-contained" ) ; 
612604    t ! ( fs:: create_dir_all( & dst) ) ; 
613605    t ! ( fs:: create_dir_all( & self_contained_dst) ) ; 
@@ -769,7 +761,7 @@ impl Step for Analysis {
769761
770762        let  src = builder
771763            . stage_out ( compiler,  Mode :: Std ) 
772-             . join ( target. triple ) 
764+             . join ( target) 
773765            . join ( builder. cargo_dir ( ) ) 
774766            . join ( "deps" ) 
775767            . join ( "save-analysis" ) ; 
@@ -1509,7 +1501,7 @@ impl Step for Extended {
15091501        tarballs. push ( builder. ensure ( Rustc  {  compiler :  builder. compiler ( stage,  target)  } ) ) ; 
15101502        tarballs. push ( builder. ensure ( Std  {  compiler,  target } ) . expect ( "missing std" ) ) ; 
15111503
1512-         if  target. ends_with ( "windows-gnu" )  { 
1504+         if  target. is_windows_gnu ( )  { 
15131505            tarballs. push ( builder. ensure ( Mingw  {  host :  target } ) . expect ( "missing mingw" ) ) ; 
15141506        } 
15151507
@@ -1683,7 +1675,7 @@ impl Step for Extended {
16831675                    prepare ( tool) ; 
16841676                } 
16851677            } 
1686-             if  target. ends_with ( "windows-gnu" )  { 
1678+             if  target. is_windows_gnu ( )  { 
16871679                prepare ( "rust-mingw" ) ; 
16881680            } 
16891681
@@ -1830,7 +1822,7 @@ impl Step for Extended {
18301822                . arg ( "-t" ) 
18311823                . arg ( etc. join ( "msi/remove-duplicates.xsl" ) ) 
18321824                . run ( builder) ; 
1833-             if  target. ends_with ( "windows-gnu" )  { 
1825+             if  target. is_windows_gnu ( )  { 
18341826                command ( & heat) 
18351827                    . current_dir ( & exe) 
18361828                    . arg ( "dir" ) 
@@ -1876,7 +1868,7 @@ impl Step for Extended {
18761868                if  built_tools. contains ( "miri" )  { 
18771869                    cmd. arg ( "-dMiriDir=miri" ) ; 
18781870                } 
1879-                 if  target. ends_with ( "windows-gnu" )  { 
1871+                 if  target. is_windows_gnu ( )  { 
18801872                    cmd. arg ( "-dGccDir=rust-mingw" ) ; 
18811873                } 
18821874                cmd. run ( builder) ; 
@@ -1901,7 +1893,7 @@ impl Step for Extended {
19011893            } 
19021894            candle ( "AnalysisGroup.wxs" . as_ref ( ) ) ; 
19031895
1904-             if  target. ends_with ( "windows-gnu" )  { 
1896+             if  target. is_windows_gnu ( )  { 
19051897                candle ( "GccGroup.wxs" . as_ref ( ) ) ; 
19061898            } 
19071899
@@ -1941,7 +1933,7 @@ impl Step for Extended {
19411933                cmd. arg ( "DocsGroup.wixobj" ) ; 
19421934            } 
19431935
1944-             if  target. ends_with ( "windows-gnu" )  { 
1936+             if  target. is_windows_gnu ( )  { 
19451937                cmd. arg ( "GccGroup.wixobj" ) ; 
19461938            } 
19471939            // ICE57 wrongly complains about the shortcuts 
@@ -1973,7 +1965,7 @@ fn add_env(builder: &Builder<'_>, cmd: &mut BootstrapCommand, target: TargetSele
19731965
19741966    if  target. contains ( "windows-gnullvm" )  { 
19751967        cmd. env ( "CFG_MINGW" ,  "1" ) . env ( "CFG_ABI" ,  "LLVM" ) ; 
1976-     }  else  if  target. contains ( "windows-gnu" )  { 
1968+     }  else  if  target. is_windows_gnu ( )  { 
19771969        cmd. env ( "CFG_MINGW" ,  "1" ) . env ( "CFG_ABI" ,  "GNU" ) ; 
19781970    }  else  { 
19791971        cmd. env ( "CFG_MINGW" ,  "0" ) . env ( "CFG_ABI" ,  "MSVC" ) ; 
@@ -2087,7 +2079,7 @@ fn maybe_install_llvm(
20872079
20882080/// Maybe add libLLVM.so to the target lib-dir for linking. 
20892081pub  fn  maybe_install_llvm_target ( builder :  & Builder < ' _ > ,  target :  TargetSelection ,  sysroot :  & Path )  { 
2090-     let  dst_libdir = sysroot. join ( "lib/rustlib" ) . join ( & * target. triple ) . join ( "lib" ) ; 
2082+     let  dst_libdir = sysroot. join ( "lib/rustlib" ) . join ( target) . join ( "lib" ) ; 
20912083    // We do not need to copy LLVM files into the sysroot if it is not 
20922084    // dynamically linked; it is already included into librustc_llvm 
20932085    // statically. 
0 commit comments