X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Flib.rs;h=abdc10c577a4f476b70929dad51499b26f1b0cfe;hb=bd1e20d49e5b67b55c22ee8927e546327d98e042;hp=3338803f9a0c771a7ef976a0afba9bd28d6ded7f;hpb=63698ecbbfec96998257424e0b09224182a81239;p=rust-lightning diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index 3338803f..abdc10c5 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -18,8 +18,8 @@ //! generated/etc. This makes it a good candidate for tight integration into an existing wallet //! instead of having a rather-separate lightning appendage to a wallet. -#![cfg_attr(not(any(test, feature = "fuzztarget", feature = "_test_utils")), deny(missing_docs))] -#![cfg_attr(not(any(test, feature = "fuzztarget", feature = "_test_utils")), forbid(unsafe_code))] +#![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), deny(missing_docs))] +#![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), forbid(unsafe_code))] #![deny(broken_intra_doc_links)] // In general, rust is absolutely horrid at supporting users doing things like, @@ -28,14 +28,19 @@ #![allow(bare_trait_objects)] #![allow(ellipsis_inclusive_range_patterns)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #![cfg_attr(all(not(feature = "std"), not(test)), no_std)] -#![cfg_attr(all(any(test, feature = "_test_utils"), feature = "unstable"), feature(test))] -#[cfg(all(any(test, feature = "_test_utils"), feature = "unstable"))] extern crate test; +#![cfg_attr(all(any(test, feature = "_test_utils"), feature = "_bench_unstable"), feature(test))] +#[cfg(all(any(test, feature = "_test_utils"), feature = "_bench_unstable"))] extern crate test; #[cfg(not(any(feature = "std", feature = "no-std")))] compile_error!("at least one of the `std` or `no-std` features must be enabled"); +#[cfg(all(fuzzing, test))] +compile_error!("Tests will always fail with cfg=fuzzing"); + #[macro_use] extern crate alloc; extern crate bitcoin; @@ -43,7 +48,7 @@ extern crate bitcoin; extern crate core; #[cfg(any(test, feature = "_test_utils"))] extern crate hex; -#[cfg(any(test, feature = "fuzztarget", feature = "_test_utils"))] extern crate regex; +#[cfg(any(test, fuzzing, feature = "_test_utils"))] extern crate regex; #[cfg(not(feature = "std"))] extern crate core2; @@ -143,9 +148,19 @@ mod prelude { pub use alloc::string::ToString; } +#[cfg(all(feature = "std", test))] +mod debug_sync; +#[cfg(all(feature = "backtrace", feature = "std", test))] +extern crate backtrace; + #[cfg(feature = "std")] mod sync { + #[cfg(test)] + pub use debug_sync::*; + #[cfg(not(test))] pub use ::std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard}; + #[cfg(not(test))] + pub use crate::util::fairrwlock::FairRwLock; } #[cfg(not(feature = "std"))]