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,8 +625,10 @@ 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.
638
- ///
628
+ #[ cfg_attr(
629
+ feature = "std" ,
630
+ doc = " See [`BackgroundProcessor::start`] for information on which actions this handles.\n "
631
+ ) ]
639
632
/// The `mobile_interruptable_platform` flag should be set if we're currently running on a
640
633
/// mobile device, where we may need to check for interruption of the application regularly. If you
641
634
/// are unsure, you should set the flag, as the performance impact of it is minimal unless there
@@ -775,7 +768,6 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
775
768
#[ cfg_attr( feature = "std" , doc = " handle.await.unwrap()" ) ]
776
769
/// # }
777
770
///```
778
- #[ cfg( feature = "futures" ) ]
779
771
pub async fn process_events_async <
780
772
' a ,
781
773
UL : ' static + Deref ,
@@ -2096,7 +2088,6 @@ mod tests {
2096
2088
}
2097
2089
2098
2090
#[ tokio:: test]
2099
- #[ cfg( feature = "futures" ) ]
2100
2091
async fn test_channel_manager_persist_error_async ( ) {
2101
2092
// Test that if we encounter an error during manager persistence, the thread panics.
2102
2093
let ( _, nodes) = create_nodes ( 2 , "test_persist_error_sync" ) ;
@@ -2605,7 +2596,6 @@ mod tests {
2605
2596
}
2606
2597
2607
2598
#[ tokio:: test]
2608
- #[ cfg( feature = "futures" ) ]
2609
2599
async fn test_not_pruning_network_graph_until_graph_sync_completion_async ( ) {
2610
2600
let ( sender, receiver) = std:: sync:: mpsc:: sync_channel ( 1 ) ;
2611
2601
@@ -2808,7 +2798,6 @@ mod tests {
2808
2798
}
2809
2799
2810
2800
#[ tokio:: test]
2811
- #[ cfg( feature = "futures" ) ]
2812
2801
async fn test_payment_path_scoring_async ( ) {
2813
2802
let ( sender, mut receiver) = tokio:: sync:: mpsc:: channel ( 1 ) ;
2814
2803
let event_handler = move |event : Event | {
0 commit comments