Skip to content

Commit 12fd0be

Browse files
committed
Always check next_route in TestRouter is fully consumed
...rather than only in std.
1 parent dcc24d1 commit 12fd0be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lightning/src/util/test_utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ impl<'a> Router for TestRouter<'a> {
113113
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
114114
}
115115

116-
#[cfg(feature = "std")] // If we put this on the `if`, we get "attributes are not yet allowed on `if` expressions" on 1.41.1
117116
impl<'a> Drop for TestRouter<'a> {
118117
fn drop(&mut self) {
119-
if std::thread::panicking() {
120-
return;
118+
#[cfg(feature = "std")] {
119+
if std::thread::panicking() {
120+
return;
121+
}
121122
}
122123
assert!(self.next_routes.lock().unwrap().is_empty());
123124
}

0 commit comments

Comments
 (0)