4
4
#![ deny( rustdoc:: broken_intra_doc_links) ]
5
5
#![ deny( rustdoc:: private_intra_doc_links) ]
6
6
#![ deny( missing_docs) ]
7
- #![ cfg_attr( not( feature = "futures" ) , deny( unsafe_code) ) ]
8
7
#![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
9
8
#![ cfg_attr( all( not( feature = "std" ) , not( test) ) , no_std) ]
10
9
@@ -25,7 +24,6 @@ use lightning::chain::chainmonitor::{ChainMonitor, Persist};
25
24
use lightning:: events:: EventHandler ;
26
25
#[ cfg( feature = "std" ) ]
27
26
use lightning:: events:: EventsProvider ;
28
- #[ cfg( feature = "futures" ) ]
29
27
use lightning:: events:: ReplayEvent ;
30
28
use lightning:: events:: { Event , PathFailure } ;
31
29
@@ -36,14 +34,12 @@ use lightning::onion_message::messenger::AOnionMessenger;
36
34
use lightning:: routing:: gossip:: { NetworkGraph , P2PGossipSync } ;
37
35
use lightning:: routing:: scoring:: { ScoreUpdate , WriteableScore } ;
38
36
use lightning:: routing:: utxo:: UtxoLookup ;
39
- #[ cfg( feature = "futures" ) ]
40
37
use lightning:: sign:: ChangeDestinationSource ;
41
38
#[ cfg( feature = "std" ) ]
42
39
use lightning:: sign:: ChangeDestinationSourceSync ;
43
40
use lightning:: sign:: OutputSpender ;
44
41
use lightning:: util:: logger:: Logger ;
45
42
use lightning:: util:: persist:: { KVStore , Persister } ;
46
- #[ cfg( feature = "futures" ) ]
47
43
use lightning:: util:: sweep:: OutputSweeper ;
48
44
#[ cfg( feature = "std" ) ]
49
45
use lightning:: util:: sweep:: OutputSweeperSync ;
@@ -146,7 +142,6 @@ const SWEEPER_TIMER: u64 = 30;
146
142
#[ cfg( test) ]
147
143
const SWEEPER_TIMER : u64 = 1 ;
148
144
149
- #[ cfg( feature = "futures" ) ]
150
145
/// core::cmp::min is not currently const, so we define a trivial (and equivalent) replacement
151
146
const fn min_u64 ( a : u64 , b : u64 ) -> u64 {
152
147
if a < b {
@@ -155,7 +150,6 @@ const fn min_u64(a: u64, b: u64) -> u64 {
155
150
b
156
151
}
157
152
}
158
- #[ cfg( feature = "futures" ) ]
159
153
const FASTEST_TIMER : u64 = min_u64 (
160
154
min_u64 ( FRESHNESS_TIMER , PING_TIMER ) ,
161
155
min_u64 ( SCORER_PERSIST_TIMER , min_u64 ( FIRST_NETWORK_PRUNE_TIMER , REBROADCAST_TIMER ) ) ,
@@ -508,7 +502,6 @@ macro_rules! define_run_body {
508
502
} }
509
503
}
510
504
511
- #[ cfg( feature = "futures" ) ]
512
505
pub ( crate ) mod futures_util {
513
506
use core:: future:: Future ;
514
507
use core:: marker:: Unpin ;
@@ -622,9 +615,7 @@ pub(crate) mod futures_util {
622
615
unsafe { Waker :: from_raw ( RawWaker :: new ( core:: ptr:: null ( ) , & DUMMY_WAKER_VTABLE ) ) }
623
616
}
624
617
}
625
- #[ cfg( feature = "futures" ) ]
626
618
use core:: task;
627
- #[ cfg( feature = "futures" ) ]
628
619
use futures_util:: { dummy_waker, OptionalSelector , Selector , SelectorOutput } ;
629
620
630
621
/// Processes background events in a future.
@@ -634,7 +625,7 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
634
625
/// future which outputs `true`, the loop will exit and this function's future will complete.
635
626
/// The `sleeper` future is free to return early after it has triggered the exit condition.
636
627
///
637
- /// See [`BackgroundProcessor::start`] for information on which actions this handles.
628
+ # [ cfg_attr ( feature = "std" , doc = " See [`BackgroundProcessor::start`] for information on which actions this handles." ) ]
638
629
///
639
630
/// The `mobile_interruptable_platform` flag should be set if we're currently running on a
640
631
/// mobile device, where we may need to check for interruption of the application regularly. If you
@@ -775,7 +766,6 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
775
766
#[ cfg_attr( feature = "std" , doc = " handle.await.unwrap()" ) ]
776
767
/// # }
777
768
///```
778
- #[ cfg( feature = "futures" ) ]
779
769
pub async fn process_events_async <
780
770
' a ,
781
771
UL : ' static + Deref ,
@@ -2096,7 +2086,6 @@ mod tests {
2096
2086
}
2097
2087
2098
2088
#[ tokio:: test]
2099
- #[ cfg( feature = "futures" ) ]
2100
2089
async fn test_channel_manager_persist_error_async ( ) {
2101
2090
// Test that if we encounter an error during manager persistence, the thread panics.
2102
2091
let ( _, nodes) = create_nodes ( 2 , "test_persist_error_sync" ) ;
@@ -2605,7 +2594,6 @@ mod tests {
2605
2594
}
2606
2595
2607
2596
#[ tokio:: test]
2608
- #[ cfg( feature = "futures" ) ]
2609
2597
async fn test_not_pruning_network_graph_until_graph_sync_completion_async ( ) {
2610
2598
let ( sender, receiver) = std:: sync:: mpsc:: sync_channel ( 1 ) ;
2611
2599
@@ -2808,7 +2796,6 @@ mod tests {
2808
2796
}
2809
2797
2810
2798
#[ tokio:: test]
2811
- #[ cfg( feature = "futures" ) ]
2812
2799
async fn test_payment_path_scoring_async ( ) {
2813
2800
let ( sender, mut receiver) = tokio:: sync:: mpsc:: channel ( 1 ) ;
2814
2801
let event_handler = move |event : Event | {
0 commit comments