@@ -645,19 +645,19 @@ impl Build {
645
645
pub fn is_flag_supported ( & self , flag : impl AsRef < OsStr > ) -> Result < bool , Error > {
646
646
self . is_flag_supported_inner (
647
647
flag. as_ref ( ) ,
648
- self . get_base_compiler ( ) ?. path ( ) ,
648
+ & self . get_base_compiler ( ) ?,
649
649
& self . get_target ( ) ?,
650
650
)
651
651
}
652
652
653
653
fn is_flag_supported_inner (
654
654
& self ,
655
655
flag : & OsStr ,
656
- compiler_path : & Path ,
656
+ tool : & Tool ,
657
657
target : & TargetInfo < ' _ > ,
658
658
) -> Result < bool , Error > {
659
659
let compiler_flag = CompilerFlag {
660
- compiler : compiler_path . into ( ) ,
660
+ compiler : tool . path ( ) . into ( ) ,
661
661
flag : flag. into ( ) ,
662
662
} ;
663
663
@@ -679,7 +679,7 @@ impl Build {
679
679
let mut compiler = {
680
680
let mut cfg = Build :: new ( ) ;
681
681
cfg. flag ( flag)
682
- . compiler ( compiler_path )
682
+ . compiler ( tool . path ( ) )
683
683
. cargo_metadata ( self . cargo_output . metadata )
684
684
. opt_level ( 0 )
685
685
. debug ( false )
@@ -1957,7 +1957,7 @@ impl Build {
1957
1957
1958
1958
for flag in self . flags_supported . iter ( ) {
1959
1959
if self
1960
- . is_flag_supported_inner ( flag, & cmd. path , & target)
1960
+ . is_flag_supported_inner ( flag, & cmd, & target)
1961
1961
. unwrap_or ( false )
1962
1962
{
1963
1963
cmd. push_cc_arg ( ( * * flag) . into ( ) ) ;
@@ -2438,13 +2438,9 @@ impl Build {
2438
2438
None => return Ok ( ( ) ) ,
2439
2439
} ;
2440
2440
2441
- let Tool {
2442
- family, path, args, ..
2443
- } = cmd;
2444
-
2445
2441
let env = env_os. to_string_lossy ( ) ;
2446
2442
let codegen_flags = RustcCodegenFlags :: parse ( & env) ?;
2447
- codegen_flags. cc_flags ( self , path , * family , target, args ) ;
2443
+ codegen_flags. cc_flags ( self , cmd , target) ;
2448
2444
Ok ( ( ) )
2449
2445
}
2450
2446
0 commit comments