mirror of https://github.com/rust-lang/cargo
Fix panic-in-panic in tests.
There are some very rare circumstances that can cause a double panic during development. For example, `.with_json("")` will panic, and then the drop will also panic.
This commit is contained in:
parent
5bb302352a
commit
fa94e8aab4
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue