aboutsummaryrefslogtreecommitdiff
path: root/rand/src/deprecated.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rand/src/deprecated.rs')
-rw-r--r--rand/src/deprecated.rs79
1 files changed, 6 insertions, 73 deletions
diff --git a/rand/src/deprecated.rs b/rand/src/deprecated.rs
index 985ae61..88eb09f 100644
--- a/rand/src/deprecated.rs
+++ b/rand/src/deprecated.rs
@@ -151,12 +151,12 @@ impl SeedableRng for ChaChaRng {
}
impl ChaChaRng {
- #[cfg(rust_1_26)]
+ #[cfg(all(rustc_1_26, not(target_os = "emscripten")))]
pub fn get_word_pos(&self) -> u128 {
self.0.get_word_pos()
}
- #[cfg(rust_1_26)]
+ #[cfg(all(rustc_1_26, not(target_os = "emscripten")))]
pub fn set_word_pos(&mut self, word_offset: u128) {
self.0.set_word_pos(word_offset)
}
@@ -291,45 +291,12 @@ impl SeedableRng for StdRng {
impl CryptoRng for StdRng {}
-#[cfg(all(feature="std",
- any(target_os = "linux", target_os = "android",
- target_os = "netbsd",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "emscripten",
- target_os = "solaris",
- target_os = "cloudabi",
- target_os = "macos", target_os = "ios",
- target_os = "freebsd",
- target_os = "openbsd", target_os = "bitrig",
- target_os = "redox",
- target_os = "fuchsia",
- windows,
- all(target_arch = "wasm32", feature = "stdweb"),
- all(target_arch = "wasm32", feature = "wasm-bindgen"),
-)))]
+#[cfg(feature="rand_os")]
#[derive(Clone, Debug)]
#[deprecated(since="0.6.0", note="import with rand::rngs::OsRng instead")]
pub struct OsRng(rngs::OsRng);
-#[cfg(all(feature="std",
- any(target_os = "linux", target_os = "android",
- target_os = "netbsd",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "emscripten",
- target_os = "solaris",
- target_os = "cloudabi",
- target_os = "macos", target_os = "ios",
- target_os = "freebsd",
- target_os = "openbsd", target_os = "bitrig",
- target_os = "redox",
- target_os = "fuchsia",
- windows,
- all(target_arch = "wasm32", feature = "stdweb"),
- all(target_arch = "wasm32", feature = "wasm-bindgen"),
-)))]
-#[cfg(feature="std")]
+#[cfg(feature="rand_os")]
impl RngCore for OsRng {
#[inline(always)]
fn next_u32(&mut self) -> u32 {
@@ -352,48 +319,14 @@ impl RngCore for OsRng {
}
}
-#[cfg(all(feature="std",
- any(target_os = "linux", target_os = "android",
- target_os = "netbsd",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "emscripten",
- target_os = "solaris",
- target_os = "cloudabi",
- target_os = "macos", target_os = "ios",
- target_os = "freebsd",
- target_os = "openbsd", target_os = "bitrig",
- target_os = "redox",
- target_os = "fuchsia",
- windows,
- all(target_arch = "wasm32", feature = "stdweb"),
- all(target_arch = "wasm32", feature = "wasm-bindgen"),
-)))]
-#[cfg(feature="std")]
+#[cfg(feature="rand_os")]
impl OsRng {
pub fn new() -> Result<Self, Error> {
rngs::OsRng::new().map(OsRng)
}
}
-#[cfg(all(feature="std",
- any(target_os = "linux", target_os = "android",
- target_os = "netbsd",
- target_os = "dragonfly",
- target_os = "haiku",
- target_os = "emscripten",
- target_os = "solaris",
- target_os = "cloudabi",
- target_os = "macos", target_os = "ios",
- target_os = "freebsd",
- target_os = "openbsd", target_os = "bitrig",
- target_os = "redox",
- target_os = "fuchsia",
- windows,
- all(target_arch = "wasm32", feature = "stdweb"),
- all(target_arch = "wasm32", feature = "wasm-bindgen"),
-)))]
-#[cfg(feature="std")]
+#[cfg(feature="rand_os")]
impl CryptoRng for OsRng {}