44#![ deny( rustdoc:: broken_intra_doc_links) ]
55#![ deny( rustdoc:: private_intra_doc_links) ]
66#![ deny( missing_docs) ]
7- #![ cfg_attr( not( feature = "futures" ) , deny( unsafe_code) ) ]
87#![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
98#![ cfg_attr( all( not( feature = "std" ) , not( test) ) , no_std) ]
109
@@ -25,7 +24,6 @@ use lightning::chain::chainmonitor::{ChainMonitor, Persist};
2524use lightning:: events:: EventHandler ;
2625#[ cfg( feature = "std" ) ]
2726use lightning:: events:: EventsProvider ;
28- #[ cfg( feature = "futures" ) ]
2927use lightning:: events:: ReplayEvent ;
3028use lightning:: events:: { Event , PathFailure } ;
3129
@@ -36,14 +34,12 @@ use lightning::onion_message::messenger::AOnionMessenger;
3634use lightning:: routing:: gossip:: { NetworkGraph , P2PGossipSync } ;
3735use lightning:: routing:: scoring:: { ScoreUpdate , WriteableScore } ;
3836use lightning:: routing:: utxo:: UtxoLookup ;
39- #[ cfg( feature = "futures" ) ]
4037use lightning:: sign:: ChangeDestinationSource ;
4138#[ cfg( feature = "std" ) ]
4239use lightning:: sign:: ChangeDestinationSourceSync ;
4340use lightning:: sign:: OutputSpender ;
4441use lightning:: util:: logger:: Logger ;
4542use lightning:: util:: persist:: { KVStore , Persister } ;
46- #[ cfg( feature = "futures" ) ]
4743use lightning:: util:: sweep:: OutputSweeper ;
4844#[ cfg( feature = "std" ) ]
4945use lightning:: util:: sweep:: OutputSweeperSync ;
@@ -146,7 +142,6 @@ const SWEEPER_TIMER: u64 = 30;
146142#[ cfg( test) ]
147143const SWEEPER_TIMER : u64 = 1 ;
148144
149- #[ cfg( feature = "futures" ) ]
150145/// core::cmp::min is not currently const, so we define a trivial (and equivalent) replacement
151146const fn min_u64 ( a : u64 , b : u64 ) -> u64 {
152147 if a < b {
@@ -155,7 +150,6 @@ const fn min_u64(a: u64, b: u64) -> u64 {
155150 b
156151 }
157152}
158- #[ cfg( feature = "futures" ) ]
159153const FASTEST_TIMER : u64 = min_u64 (
160154 min_u64 ( FRESHNESS_TIMER , PING_TIMER ) ,
161155 min_u64 ( SCORER_PERSIST_TIMER , min_u64 ( FIRST_NETWORK_PRUNE_TIMER , REBROADCAST_TIMER ) ) ,
@@ -508,7 +502,6 @@ macro_rules! define_run_body {
508502 } }
509503}
510504
511- #[ cfg( feature = "futures" ) ]
512505pub ( crate ) mod futures_util {
513506 use core:: future:: Future ;
514507 use core:: marker:: Unpin ;
@@ -622,9 +615,7 @@ pub(crate) mod futures_util {
622615 unsafe { Waker :: from_raw ( RawWaker :: new ( core:: ptr:: null ( ) , & DUMMY_WAKER_VTABLE ) ) }
623616 }
624617}
625- #[ cfg( feature = "futures" ) ]
626618use core:: task;
627- #[ cfg( feature = "futures" ) ]
628619use futures_util:: { dummy_waker, OptionalSelector , Selector , SelectorOutput } ;
629620
630621/// Processes background events in a future.
@@ -634,8 +625,10 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
634625/// future which outputs `true`, the loop will exit and this function's future will complete.
635626/// The `sleeper` future is free to return early after it has triggered the exit condition.
636627///
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+ ) ]
639632/// The `mobile_interruptable_platform` flag should be set if we're currently running on a
640633/// mobile device, where we may need to check for interruption of the application regularly. If you
641634/// 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};
775768#[ cfg_attr( feature = "std" , doc = " handle.await.unwrap()" ) ]
776769/// # }
777770///```
778- #[ cfg( feature = "futures" ) ]
779771pub async fn process_events_async <
780772 ' a ,
781773 UL : ' static + Deref ,
@@ -2096,7 +2088,6 @@ mod tests {
20962088 }
20972089
20982090 #[ tokio:: test]
2099- #[ cfg( feature = "futures" ) ]
21002091 async fn test_channel_manager_persist_error_async ( ) {
21012092 // Test that if we encounter an error during manager persistence, the thread panics.
21022093 let ( _, nodes) = create_nodes ( 2 , "test_persist_error_sync" ) ;
@@ -2605,7 +2596,6 @@ mod tests {
26052596 }
26062597
26072598 #[ tokio:: test]
2608- #[ cfg( feature = "futures" ) ]
26092599 async fn test_not_pruning_network_graph_until_graph_sync_completion_async ( ) {
26102600 let ( sender, receiver) = std:: sync:: mpsc:: sync_channel ( 1 ) ;
26112601
@@ -2808,7 +2798,6 @@ mod tests {
28082798 }
28092799
28102800 #[ tokio:: test]
2811- #[ cfg( feature = "futures" ) ]
28122801 async fn test_payment_path_scoring_async ( ) {
28132802 let ( sender, mut receiver) = tokio:: sync:: mpsc:: channel ( 1 ) ;
28142803 let event_handler = move |event : Event | {
0 commit comments