@@ -645,19 +645,19 @@ impl Build {
645645 pub fn is_flag_supported ( & self , flag : impl AsRef < OsStr > ) -> Result < bool , Error > {
646646 self . is_flag_supported_inner (
647647 flag. as_ref ( ) ,
648- self . get_base_compiler ( ) ?. path ( ) ,
648+ & self . get_base_compiler ( ) ?,
649649 & self . get_target ( ) ?,
650650 )
651651 }
652652
653653 fn is_flag_supported_inner (
654654 & self ,
655655 flag : & OsStr ,
656- compiler_path : & Path ,
656+ tool : & Tool ,
657657 target : & TargetInfo < ' _ > ,
658658 ) -> Result < bool , Error > {
659659 let compiler_flag = CompilerFlag {
660- compiler : compiler_path . into ( ) ,
660+ compiler : tool . path ( ) . into ( ) ,
661661 flag : flag. into ( ) ,
662662 } ;
663663
@@ -679,7 +679,7 @@ impl Build {
679679 let mut compiler = {
680680 let mut cfg = Build :: new ( ) ;
681681 cfg. flag ( flag)
682- . compiler ( compiler_path )
682+ . compiler ( tool . path ( ) )
683683 . cargo_metadata ( self . cargo_output . metadata )
684684 . opt_level ( 0 )
685685 . debug ( false )
@@ -1957,7 +1957,7 @@ impl Build {
19571957
19581958 for flag in self . flags_supported . iter ( ) {
19591959 if self
1960- . is_flag_supported_inner ( flag, & cmd. path , & target)
1960+ . is_flag_supported_inner ( flag, & cmd, & target)
19611961 . unwrap_or ( false )
19621962 {
19631963 cmd. push_cc_arg ( ( * * flag) . into ( ) ) ;
@@ -2438,13 +2438,9 @@ impl Build {
24382438 None => return Ok ( ( ) ) ,
24392439 } ;
24402440
2441- let Tool {
2442- family, path, args, ..
2443- } = cmd;
2444-
24452441 let env = env_os. to_string_lossy ( ) ;
24462442 let codegen_flags = RustcCodegenFlags :: parse ( & env) ?;
2447- codegen_flags. cc_flags ( self , path , * family , target, args ) ;
2443+ codegen_flags. cc_flags ( self , cmd , target) ;
24482444 Ok ( ( ) )
24492445 }
24502446
0 commit comments