Merge pull request #1130 from dhardy/work

serde for BlockRng, ReseedingRng and ReadRng
diff --git a/Cargo.toml b/Cargo.toml
index a1bfb5b..7111e48 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,7 @@
 # Meta-features:
 default = ["std", "std_rng"]
 nightly = [] # enables performance optimizations requiring nightly rust
-serde1 = ["serde"]
+serde1 = ["serde", "rand_core/serde1"]
 
 # Option (enabled by default): without "std" rand uses libcore; this option
 # enables functionality expected to be available on a standard platform.
@@ -62,7 +62,7 @@
 [dependencies.packed_simd]
 # NOTE: so far no version works reliably due to dependence on unstable features
 package = "packed_simd_2"
-version = "0.3.4"
+version = "0.3.5"
 optional = true
 features = ["into_bits"]
 
diff --git a/rand_core/src/block.rs b/rand_core/src/block.rs
index 005d071..a54cadf 100644
--- a/rand_core/src/block.rs
+++ b/rand_core/src/block.rs
@@ -114,6 +114,12 @@
 /// [`try_fill_bytes`]: RngCore::try_fill_bytes
 #[derive(Clone)]
 #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
+#[cfg_attr(
+    feature = "serde1",
+    serde(
+        bound = "for<'x> R: Serialize + Deserialize<'x> + Sized, for<'x> R::Results: Serialize + Deserialize<'x>"
+    )
+)]
 pub struct BlockRng<R: BlockRngCore + ?Sized> {
     results: R::Results,
     index: usize,
diff --git a/src/rngs/adapter/mod.rs b/src/rngs/adapter/mod.rs
index 22b7158..bd1d294 100644
--- a/src/rngs/adapter/mod.rs
+++ b/src/rngs/adapter/mod.rs
@@ -11,5 +11,6 @@
 mod read;
 mod reseeding;
 
+#[allow(deprecated)]
 pub use self::read::{ReadError, ReadRng};
 pub use self::reseeding::ReseedingRng;
diff --git a/src/rngs/adapter/read.rs b/src/rngs/adapter/read.rs
index 63b0dd0..25a9ca7 100644
--- a/src/rngs/adapter/read.rs
+++ b/src/rngs/adapter/read.rs
@@ -9,6 +9,8 @@
 
 //! A wrapper around any Read to treat it as an RNG.
 
+#![allow(deprecated)]
+
 use std::fmt;
 use std::io::Read;
 
@@ -30,20 +32,10 @@
 /// have enough data, will only be reported through [`try_fill_bytes`].
 /// The other [`RngCore`] methods will panic in case of an error.
 ///
-/// # Example
-///
-/// ```
-/// use rand::Rng;
-/// use rand::rngs::adapter::ReadRng;
-///
-/// let data = vec![1, 2, 3, 4, 5, 6, 7, 8];
-/// let mut rng = ReadRng::new(&data[..]);
-/// println!("{:x}", rng.gen::<u32>());
-/// ```
-///
 /// [`OsRng`]: crate::rngs::OsRng
 /// [`try_fill_bytes`]: RngCore::try_fill_bytes
 #[derive(Debug)]
+#[deprecated(since="0.8.4", note="removal due to lack of usage")]
 pub struct ReadRng<R> {
     reader: R,
 }
@@ -86,6 +78,7 @@
 
 /// `ReadRng` error type
 #[derive(Debug)]
+#[deprecated(since="0.8.4")]
 pub struct ReadError(std::io::Error);
 
 impl fmt::Display for ReadError {