Skip to content

Commit b735ff3

Browse files
authored
minor: improve compile error when sync and tokio-runtime features are enabled (#788)
1 parent 2ec4cc0 commit b735ff3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,17 @@ pub use crate::client::csfle::client_encryption;
358358

359359
pub use {client::session::ClusterTime, coll::Namespace, index::IndexModel, sdam::public::*};
360360

361-
#[cfg(all(feature = "tokio-runtime", feature = "async-std-runtime",))]
361+
#[cfg(all(feature = "tokio-runtime", feature = "sync",))]
362+
compile_error!(
363+
"`tokio-runtime` and `sync` can't both be enabled; either switch to using `tokio-sync` or set \
364+
`default-features = false` in your Cargo.toml"
365+
);
366+
367+
#[cfg(all(
368+
feature = "tokio-runtime",
369+
feature = "async-std-runtime",
370+
not(feature = "sync")
371+
))]
362372
compile_error!(
363373
"`tokio-runtime` and `async-std-runtime` can't both be enabled; either disable \
364374
`async-std-runtime` or set `default-features = false` in your Cargo.toml"

0 commit comments

Comments
 (0)