Skip to content

Commit

Permalink
Auto merge of #6431 - ehuss:panic-in-panic, r=nrc
Browse files Browse the repository at this point in the history
Fix panic-in-panic in tests.

There are some very rare circumstances that can cause a double panic during
development. For example, `.with_json("")` (or any invalid JSON) will panic, and then the drop
will also panic.  This can cause a confusing SIGILL.
  • Loading branch information
bors committed Dec 13, 2018
2 parents 5bb3023 + fa94e8a commit 79f962f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/testsuite/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ impl Execs {

impl Drop for Execs {
fn drop(&mut self) {
if !self.ran {
if !self.ran && !std::thread::panicking() {
panic!("forgot to run this command");
}
}
Expand Down

0 comments on commit 79f962f

Please sign in to comment.