about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-07-24 11:42:06 -0700
committerGitHub <noreply@github.com>2016-07-24 11:42:06 -0700
commit9316ae515e2f8f3f497fb4f1559910c1eef2433d (patch)
tree55141cdef2ce60b07578873cd760ec87ad91a263 /src/libstd
parent2c50f4e484d1c871538ee99032ec2986177b8062 (diff)
parent52c293c2bb3be96f3a8cc4043037e90e5ed4dda8 (diff)
downloadrust-9316ae515e2f8f3f497fb4f1559910c1eef2433d.tar.gz
rust-9316ae515e2f8f3f497fb4f1559910c1eef2433d.zip
Auto merge of #35006 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #34965, #34972, #34975, #34976, #34977, #34988, #34989
- Failed merges:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/map.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index a03249e0063..ed5ac3bc0c1 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -1699,6 +1699,17 @@ impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HashMap<K, V, S>
 /// A particular instance `RandomState` will create the same instances of
 /// `Hasher`, but the hashers created by two different `RandomState`
 /// instances are unlikely to produce the same result for the same values.
+///
+/// # Examples
+///
+/// ```
+/// use std::collections::HashMap;
+/// use std::collections::hash_map::RandomState;
+///
+/// let s = RandomState::new();
+/// let mut map = HashMap::with_hasher(s);
+/// map.insert(1, 2);
+/// ```
 #[derive(Clone)]
 #[stable(feature = "hashmap_build_hasher", since = "1.7.0")]
 pub struct RandomState {
@@ -1708,6 +1719,14 @@ pub struct RandomState {
 
 impl RandomState {
     /// Constructs a new `RandomState` that is initialized with random keys.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::collections::hash_map::RandomState;
+    ///
+    /// let s = RandomState::new();
+    /// ```
     #[inline]
     #[allow(deprecated)] // rand
     #[stable(feature = "hashmap_build_hasher", since = "1.7.0")]