@@ -274,7 +274,7 @@ impl PathSet {
274274 /// This is used for `StepDescription::krate`, which passes all matching crates at once to
275275 /// `Step::make_run`, rather than calling it many times with a single crate.
276276 /// 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 {
278278 let mut check = |p| {
279279 for ( i, n) in needles. iter ( ) . enumerate ( ) {
280280 let matched = Self :: check ( p, n, module) ;
@@ -346,7 +346,7 @@ const PATH_REMAP: &[(&str, &[&str])] = &[
346346 ) ,
347347] ;
348348
349- fn remap_paths ( paths : & mut Vec < & Path > ) {
349+ fn remap_paths ( paths : & mut Vec < PathBuf > ) {
350350 let mut remove = vec ! [ ] ;
351351 let mut add = vec ! [ ] ;
352352 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>) {
355355 // Remove leading and trailing slashes so `tests/` and `tests` are equivalent
356356 if path. trim_matches ( std:: path:: is_separator) == search {
357357 remove. push ( i) ;
358- add. extend ( replace. iter ( ) . map ( Path :: new ) ) ;
358+ add. extend ( replace. iter ( ) . map ( PathBuf :: from ) ) ;
359359 break ;
360360 }
361361 }
@@ -439,7 +439,7 @@ impl StepDescription {
439439 }
440440
441441 // Attempt to resolve paths to be relative to the builder source directory.
442- let paths: Vec < _ > = paths
442+ let mut paths: Vec < PathBuf > = paths
443443 . iter ( )
444444 . map ( |p| {
445445 // 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 {
458458 } )
459459 . collect ( ) ;
460460
461- // Convert Vec<PathBuf> to `Vec<&Path>`
462- let mut paths: Vec < & Path > = paths. iter ( ) . map ( |p| p. as_ref ( ) ) . collect ( ) ;
463-
464461 remap_paths ( & mut paths) ;
465462
466463 // Handle all test suite paths.
@@ -649,7 +646,7 @@ impl<'a> ShouldRun<'a> {
649646 /// (for now, just `all_krates` and `paths`, but we may want to add an `aliases` function in the future?)
650647 fn pathset_for_paths_removing_matches (
651648 & self ,
652- paths : & mut Vec < & Path > ,
649+ paths : & mut Vec < PathBuf > ,
653650 kind : Kind ,
654651 ) -> Vec < PathSet > {
655652 let mut sets = vec ! [ ] ;
0 commit comments