@@ -975,17 +975,20 @@ pub fn print_native_static_libs(sess: &Session, all_native_libs: &[NativeLibrary
975
975
// We prefer system mingw-w64 libraries if they are available to avoid this issue.
976
976
fn get_crt_libs_path ( sess : & Session ) -> Option < PathBuf > {
977
977
fn find_exe_in_path < P > ( exe_name : P ) -> Option < PathBuf >
978
- where P : AsRef < Path > ,
978
+ where
979
+ P : AsRef < Path > ,
979
980
{
980
981
env:: var_os ( "PATH" ) . and_then ( |paths| {
981
- env:: split_paths ( & paths) . filter_map ( |dir| {
982
- let full_path = dir. join ( & exe_name) ;
983
- if full_path. is_file ( ) {
984
- Some ( fix_windows_verbatim_for_gcc ( & full_path) )
985
- } else {
986
- None
987
- }
988
- } ) . next ( )
982
+ env:: split_paths ( & paths)
983
+ . filter_map ( |dir| {
984
+ let full_path = dir. join ( & exe_name) ;
985
+ if full_path. is_file ( ) {
986
+ Some ( fix_windows_verbatim_for_gcc ( & full_path) )
987
+ } else {
988
+ None
989
+ }
990
+ } )
991
+ . next ( )
989
992
} )
990
993
}
991
994
@@ -1000,15 +1003,11 @@ fn get_crt_libs_path(sess: &Session) -> Option<PathBuf> {
1000
1003
Some ( Err ( _) ) => None ,
1001
1004
_ => {
1002
1005
if let ( linker, LinkerFlavor :: Gcc ) = linker_and_flavor ( & sess) {
1003
- let linker_path = if cfg ! ( windows) {
1004
- linker. with_extension ( "exe" )
1005
- } else {
1006
- linker
1007
- } ;
1006
+ let linker_path = if cfg ! ( windows) { linker. with_extension ( "exe" ) } else { linker } ;
1008
1007
if let Some ( linker_path) = find_exe_in_path ( linker_path) {
1009
1008
let mingw_arch = match & sess. target . target . arch {
1010
1009
x if x == "x86" => "i686" ,
1011
- x => x
1010
+ x => x,
1012
1011
} ;
1013
1012
let mingw_dir = [ mingw_arch, "-w64-mingw32" ] . concat ( ) ;
1014
1013
// Here we have path/bin/gcc but we need path/
0 commit comments