From: Matt Corallo Date: Fri, 3 Feb 2023 02:17:41 +0000 (+0000) Subject: Always check `next_route` in `TestRouter` is fully consumed X-Git-Tag: v0.0.114-beta~14^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=1dc96cbde2bb24e8d92cc7a54947592ac495fedc;p=rust-lightning Always check `next_route` in `TestRouter` is fully consumed ...rather than only in std. --- diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index 83647a733..2d68e74c2 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -114,11 +114,12 @@ impl<'a> Router for TestRouter<'a> { fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {} } -#[cfg(feature = "std")] // If we put this on the `if`, we get "attributes are not yet allowed on `if` expressions" on 1.41.1 impl<'a> Drop for TestRouter<'a> { fn drop(&mut self) { - if std::thread::panicking() { - return; + #[cfg(feature = "std")] { + if std::thread::panicking() { + return; + } } assert!(self.next_routes.lock().unwrap().is_empty()); }