diff --git a/build.rs b/build.rs new file mode 100644 index 000000000..52fd48b1e --- /dev/null +++ b/build.rs @@ -0,0 +1,23 @@ +fn main() { + #[cfg(not(any( + feature = "runtime-tokio-hyper", + feature = "runtime-tokio-hyper-rustls", + feature = "runtime-tokio-hyper-rustls-webpki", + feature = "runtime-blocking", + feature = "runtime-blocking-rustls", + feature = "runtime-blocking-rustls-webpki", + feature = "runtime-async-std-surf", + )))] + compile_error!( + r"one of the following runtime features must be enabled: + [ + 'runtime-tokio-hyper', + 'runtime-tokio-hyper-rustls', + 'runtime-tokio-hyper-rustls-webpki', + 'runtime-blocking', + 'runtime-blocking-rustls', + 'runtime-blocking-rustls-webpki', + 'runtime-async-std-surf' + ]" + ); +} diff --git a/src/lib.rs b/src/lib.rs index e83b56b10..11bcab1ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,28 +61,6 @@ // a runtime feature, but that does not seem currently possible: // https://github.com/rust-lang/rust/issues/68838 -#[cfg(not(any( - feature = "runtime-tokio-hyper", - feature = "runtime-tokio-hyper-rustls", - feature = "runtime-tokio-hyper-rustls-webpki", - feature = "runtime-blocking", - feature = "runtime-blocking-rustls", - feature = "runtime-blocking-rustls-webpki", - feature = "runtime-async-std-surf", -)))] -compile_error!( - r"one of the following runtime features must be enabled: - [ - 'runtime-tokio-hyper', - 'runtime-tokio-hyper-rustls', - 'runtime-tokio-hyper-rustls-webpki', - 'runtime-blocking', - 'runtime-blocking-rustls', - 'runtime-blocking-rustls-webpki', - 'runtime-async-std-surf' - ]" -); - mod client; mod error; mod ids;