Skip to content

Commit

Permalink
Rollup merge of rust-lang#108313 - chenyukang:yukang/fix-only-modifie…
Browse files Browse the repository at this point in the history
…d, r=oli-obk

Fix compiletest possible crash in option only-modified

`fixed` files maybe removed, `unwrap` will crash in this scenario.
  • Loading branch information
compiler-errors authored Feb 21, 2023
2 parents c4d5cb4 + 6e34e65 commit f047f6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ fn modified_tests(config: &Config, dir: &Path) -> Result<Vec<PathBuf>, String> {
let full_paths = {
let mut full_paths: Vec<PathBuf> = all_paths
.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();
full_paths.dedup();
full_paths.sort_unstable();
Expand Down

0 comments on commit f047f6a

Please sign in to comment.