about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@cardoe.com>2016-04-20 13:28:05 -0400
committerDoug Goldstein <cardoe@cardoe.com>2016-04-20 20:21:01 -0500
commit121225f17d039e51ea462437189c7c5d229291a8 (patch)
tree965e929c58e1722148c454bc998fbb1804abc524 /src/libstd
parentf875daca54b14d74a3b236b971b88d5e5f739b81 (diff)
downloadrust-121225f17d039e51ea462437189c7c5d229291a8.tar.gz
rust-121225f17d039e51ea462437189c7c5d229291a8.zip
HashMap: add info to docs about random seed quality
The random functions that HashMap use make no guarantees about the
quality of random data so this documents that to the user so that they
are aware. This was brought about by the change to the Linux random code
to not block until the urandom pool was initialized to avoid users of
crates that internally use HashMap being caught unaware and having their
application block until the urandom pool is initialized.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/map.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index c20270e8306..3de9276b5ac 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -202,8 +202,10 @@ fn test_resize_policy() {
 /// The hashes are all keyed by the thread-local random number generator
 /// on creation by default. This means that the ordering of the keys is
 /// randomized, but makes the tables more resistant to
-/// denial-of-service attacks (Hash DoS). This behavior can be
-/// overridden with one of the constructors.
+/// denial-of-service attacks (Hash DoS). No guarantees are made to the
+/// quality of the random data. The implementation uses the best available
+/// random data from your platform at the time of creation. This behavior
+/// can be overridden with one of the constructors.
 ///
 /// It is required that the keys implement the `Eq` and `Hash` traits, although
 /// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`.