Skip to content

Commit d122bbc

Browse files
committed
Emit a compiler error with futures 0.3 and atomics
Not implemented yet, and the one there doesn't work with atomics! (we'll get around to this soon-ish)
1 parent 02be369 commit d122bbc

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

crates/futures/src/lib.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,24 @@ use cfg_if::cfg_if;
109109
cfg_if! {
110110
if #[cfg(target_feature = "atomics")] {
111111
/// Contains a thread-safe version of this crate, with Futures 0.1
112-
pub mod atomics;
112+
mod atomics;
113113

114114
/// Polyfill for `Atomics.waitAsync` function
115115
mod polyfill;
116116

117117
pub use atomics::*;
118-
} else if #[cfg(feature = "futures_0_3")] {
118+
} else {
119+
mod stable;
120+
pub use stable::*;
121+
}
122+
}
123+
124+
#[cfg(feature = "futures_0_3")]
125+
cfg_if! {
126+
if #[cfg(target_feature = "atomics")] {
127+
compile_error!("futures 0.3 support is not implemented with atomics yet");
128+
} else {
119129
/// Contains a Futures 0.3 implementation of this crate.
120130
pub mod futures_0_3;
121-
122-
/// Contains stable version of the crate
123-
pub mod stable;
124-
pub use stable::*;
125-
} else {
126-
/// Contains stable version of the crate
127-
pub mod stable;
128-
pub use stable::*;
129131
}
130132
}

0 commit comments

Comments
 (0)