about summary refs log tree commit diff
path: root/src/liballoc/btree
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc/btree')
-rw-r--r--src/liballoc/btree/map.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/liballoc/btree/map.rs b/src/liballoc/btree/map.rs
index b114dc640fb..b320bed5432 100644
--- a/src/liballoc/btree/map.rs
+++ b/src/liballoc/btree/map.rs
@@ -1748,6 +1748,11 @@ impl<'a, K: Ord, Q: ?Sized, V> Index<&'a Q> for BTreeMap<K, V>
 {
     type Output = V;
 
+    /// Returns a reference to the value corresponding to the supplied key.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the key is not present in the `BTreeMap`.
     #[inline]
     fn index(&self, key: &Q) -> &V {
         self.get(key).expect("no entry found for key")