Skip to content

Commit

Permalink
Unrolled build for rust-lang#123224
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Mar 30, 2024
2 parents 40116ad + b20e267 commit 5ab7c8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,9 @@ pub fn make_tests(
&modified_tests,
&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 {
eprintln!();
Expand Down

0 comments on commit 5ab7c8d

Please sign in to comment.