Add a `#[macro_use]` on the `alloc` import for `format!()`
[rust-lightning] / lightning / src / lib.rs
index 1088063540c97f51e03d0bcebbcde1773fb83970..5c414b7b233caa0c86aec510b548f993214c7e0b 100644 (file)
@@ -31,6 +31,7 @@
 #![cfg_attr(all(any(test, feature = "_test_utils"), feature = "unstable"), feature(test))]
 #[cfg(all(any(test, feature = "_test_utils"), feature = "unstable"))] extern crate test;
 
+#[macro_use]
 extern crate alloc;
 extern crate bitcoin;
 extern crate core;
@@ -54,6 +55,10 @@ mod prelude {
        pub use self::hashbrown::{HashMap, HashSet, hash_map};
 }
 
+#[cfg(feature = "std")]
 mod sync {
        pub use ::std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard};
 }
+
+#[cfg(not(feature = "std"))]
+mod sync;