diff options
Diffstat (limited to 'vendor/futures-util/src/stream/futures_unordered/abort.rs')
-rw-r--r-- | vendor/futures-util/src/stream/futures_unordered/abort.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/futures-util/src/stream/futures_unordered/abort.rs b/vendor/futures-util/src/stream/futures_unordered/abort.rs new file mode 100644 index 000000000..1a42d2436 --- /dev/null +++ b/vendor/futures-util/src/stream/futures_unordered/abort.rs @@ -0,0 +1,12 @@ +pub(super) fn abort(s: &str) -> ! { + struct DoublePanic; + + impl Drop for DoublePanic { + fn drop(&mut self) { + panic!("panicking twice to abort the program"); + } + } + + let _bomb = DoublePanic; + panic!("{}", s); +} |