about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-08-05 12:16:37 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-08-05 12:32:35 -0400
commit4a68a7e1986c55855727c818ef272108f8fed32e (patch)
tree7300b4e4340d687e9ab17c3ebc432345e1d7a0aa
parentd03456183e85fe7bd465bbe7c8f67885a2528444 (diff)
downloadrust-4a68a7e1986c55855727c818ef272108f8fed32e.tar.gz
rust-4a68a7e1986c55855727c818ef272108f8fed32e.zip
Make note of Hash in Borrow's docs
This should be a bit more prominent.

Fixes #27109
-rw-r--r--src/libcollections/borrow.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcollections/borrow.rs b/src/libcollections/borrow.rs
index 1c75636cb05..a7b4c17314b 100644
--- a/src/libcollections/borrow.rs
+++ b/src/libcollections/borrow.rs
@@ -38,6 +38,9 @@ use self::Cow::*;
 /// type can be borrowed as multiple different types. In particular, `Vec<T>:
 /// Borrow<Vec<T>>` and `Vec<T>: Borrow<[T]>`.
 ///
+/// If you are implementing `Borrow` and both `Self` and `Borrowed` implement
+/// `Hash`, `Eq`, and/or `Ord`, they must produce the same result.
+///
 /// `Borrow` is very similar to, but different than, `AsRef`. See
 /// [the book][book] for more.
 ///