From 1dc96cbde2bb24e8d92cc7a54947592ac495fedc Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 3 Feb 2023 02:17:41 +0000 Subject: [PATCH] Always check `next_route` in `TestRouter` is fully consumed ...rather than only in std. --- lightning/src/util/test_utils.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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()); } -- 2.39.5