diff options
| -rw-r--r-- | src/bootstrap/test.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index a3d96836aad..3847a2a1e46 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1184,8 +1184,13 @@ impl Step for Compiletest { Err(_) => p, } }) - .filter(|p| p.starts_with(suite_path) && p.is_file()) - .map(|p| p.strip_prefix(suite_path).unwrap().to_str().unwrap()) + .filter(|p| p.starts_with(suite_path) && (p.is_dir() || p.is_file())) + .filter_map(|p| { + match p.strip_prefix(suite_path).ok().and_then(|p| p.to_str()) { + Some(s) if s != "" => Some(s), + _ => None, + } + }) .collect(); test_args.append(&mut builder.config.cmd.test_args()); |
