Rollup merge of #123224 - pacak:better-error-message, r=compiler-errors

compiletest: print reason for failing to read tests

Turns this
```
Could not read tests from /path/to/rust/tests/run-make
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:05
```
into this:
```
Could not read tests from /path/to/rust/tests/run-make: run-make tests cannot have both `Makefile` and `rmake.rs`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:05
```

While first one is technically correct - it's not helpful at all, adding backtrace is not making it any better.
This commit is contained in:
Matthias Krüger 2024-03-30 14:30:51 +01:00 committed by GitHub
commit 9b067df618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -571,7 +571,9 @@ pub fn make_tests(
&modified_tests, &modified_tests,
&mut poisoned, &mut poisoned,
) )
.unwrap_or_else(|_| panic!("Could not read tests from {}", config.src_base.display())); .unwrap_or_else(|reason| {
panic!("Could not read tests from {}: {reason}", config.src_base.display())
});
if poisoned { if poisoned {
eprintln!(); eprintln!();