@@ -274,7 +274,7 @@ impl PathSet {
274
274
/// This is used for `StepDescription::krate`, which passes all matching crates at once to
275
275
/// `Step::make_run`, rather than calling it many times with a single crate.
276
276
/// See `tests.rs` for examples.
277
- fn intersection_removing_matches ( & self , needles : & mut Vec < & Path > , module : Kind ) -> PathSet {
277
+ fn intersection_removing_matches ( & self , needles : & mut Vec < PathBuf > , module : Kind ) -> PathSet {
278
278
let mut check = |p| {
279
279
for ( i, n) in needles. iter ( ) . enumerate ( ) {
280
280
let matched = Self :: check ( p, n, module) ;
@@ -346,7 +346,7 @@ const PATH_REMAP: &[(&str, &[&str])] = &[
346
346
) ,
347
347
] ;
348
348
349
- fn remap_paths ( paths : & mut Vec < & Path > ) {
349
+ fn remap_paths ( paths : & mut Vec < PathBuf > ) {
350
350
let mut remove = vec ! [ ] ;
351
351
let mut add = vec ! [ ] ;
352
352
for ( i, path) in paths. iter ( ) . enumerate ( ) . filter_map ( |( i, path) | path. to_str ( ) . map ( |s| ( i, s) ) )
@@ -355,7 +355,7 @@ fn remap_paths(paths: &mut Vec<&Path>) {
355
355
// Remove leading and trailing slashes so `tests/` and `tests` are equivalent
356
356
if path. trim_matches ( std:: path:: is_separator) == search {
357
357
remove. push ( i) ;
358
- add. extend ( replace. iter ( ) . map ( Path :: new ) ) ;
358
+ add. extend ( replace. iter ( ) . map ( PathBuf :: from ) ) ;
359
359
break ;
360
360
}
361
361
}
@@ -439,7 +439,7 @@ impl StepDescription {
439
439
}
440
440
441
441
// Attempt to resolve paths to be relative to the builder source directory.
442
- let paths: Vec < _ > = paths
442
+ let mut paths: Vec < PathBuf > = paths
443
443
. iter ( )
444
444
. map ( |p| {
445
445
// If the path does not exist, it may represent the name of a Step, such as `tidy` in `x test tidy`
@@ -458,9 +458,6 @@ impl StepDescription {
458
458
} )
459
459
. collect ( ) ;
460
460
461
- // Convert Vec<PathBuf> to `Vec<&Path>`
462
- let mut paths: Vec < & Path > = paths. iter ( ) . map ( |p| p. as_ref ( ) ) . collect ( ) ;
463
-
464
461
remap_paths ( & mut paths) ;
465
462
466
463
// Handle all test suite paths.
@@ -649,7 +646,7 @@ impl<'a> ShouldRun<'a> {
649
646
/// (for now, just `all_krates` and `paths`, but we may want to add an `aliases` function in the future?)
650
647
fn pathset_for_paths_removing_matches (
651
648
& self ,
652
- paths : & mut Vec < & Path > ,
649
+ paths : & mut Vec < PathBuf > ,
653
650
kind : Kind ,
654
651
) -> Vec < PathSet > {
655
652
let mut sets = vec ! [ ] ;
0 commit comments