File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -982,18 +982,30 @@ impl Compilation for RustCompilation {
982
982
cwd : cwd. to_owned ( ) ,
983
983
} ;
984
984
985
+ macro_rules! try_string_arg {
986
+ ( $e: expr) => {
987
+ match $e {
988
+ Ok ( s) => s,
989
+ Err ( e) => {
990
+ debug!( "Conversion failed for distributed compile argument: {}" , e) ;
991
+ return None
992
+ } ,
993
+ }
994
+ } ;
995
+ }
985
996
let dist_command = ( || {
986
997
let mut dist_arguments = vec ! [ ] ;
987
998
// flat_map would be nice but the lifetimes don't work out
988
999
for argument in arguments. iter ( ) {
989
- for string_arg in argument. iter_strings ( |p| path_transformer. to_dist ( p) ) {
990
- dist_arguments. push ( match string_arg {
991
- Ok ( s) => s,
992
- Err ( e) => {
993
- debug ! ( "Conversion failed for distributed compile argument: {}" , e) ;
994
- return None
995
- } ,
996
- } )
1000
+ let path_transformer_fn = & mut |p : & Path | path_transformer. to_dist ( p) ;
1001
+ if let Argument :: Raw ( input_path) = argument {
1002
+ // Need to explicitly handle the input argument as it's not parsed as a path
1003
+ let input_path = Path :: new ( input_path) . to_owned ( ) ;
1004
+ dist_arguments. push ( try_string_arg ! ( input_path. into_arg_string( path_transformer_fn) ) )
1005
+ } else {
1006
+ for string_arg in argument. iter_strings ( path_transformer_fn) {
1007
+ dist_arguments. push ( try_string_arg ! ( string_arg) )
1008
+ }
997
1009
}
998
1010
}
999
1011
You can’t perform that action at this time.
0 commit comments