From 693fb24e025185573d2a40031780bf501754dde6 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 3 Feb 2021 17:29:24 +1100 Subject: [PATCH] Emit specific compile error if incompatible features are enabled This is motivated by the feature `electrum` being part of the `default` features of this crate. It is easy to naively enable `esplora` and `async-interface` and forget that `electrum` is enabled by default, running into not so obvious compile errors. --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 3221dde7..197613af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -210,6 +210,11 @@ extern crate serde; #[macro_use] extern crate serde_json; +#[cfg(all(feature = "async-interface", feature = "electrum"))] +compile_error!( + "Features async-interface and electrum are mutually exclusive and cannot be enabled together" +); + #[cfg(feature = "keys-bip39")] extern crate bip39;