mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
Fix compiletest crash when test file path does not exist
This commit is contained in:
parent
bda32a4023
commit
6e34e651a6
@ -588,7 +588,8 @@ fn modified_tests(config: &Config, dir: &Path) -> Result<Vec<PathBuf>, String> {
|
|||||||
let full_paths = {
|
let full_paths = {
|
||||||
let mut full_paths: Vec<PathBuf> = all_paths
|
let mut full_paths: Vec<PathBuf> = all_paths
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|f| fs::canonicalize(&f).unwrap().with_extension("").with_extension("rs"))
|
.map(|f| PathBuf::from(f).with_extension("").with_extension("rs"))
|
||||||
|
.filter_map(|f| if Path::new(&f).exists() { f.canonicalize().ok() } else { None })
|
||||||
.collect();
|
.collect();
|
||||||
full_paths.dedup();
|
full_paths.dedup();
|
||||||
full_paths.sort_unstable();
|
full_paths.sort_unstable();
|
||||||
|
Loading…
Reference in New Issue
Block a user