about summary refs log tree commit diff
path: root/library/std/src/error.rs
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-03-04 15:57:26 +0100
committerMara Bos <m-ou.se@m-ou.se>2021-03-04 15:58:50 +0100
commitd85d82ab2234cf08e2e86575d0cdebefdb819831 (patch)
treef83a52337fab8c386b8dfdd092ee458f43e760e3 /library/std/src/error.rs
parent69d95e232af0fe81de85e1e4a1f8dc73d7b0f16c (diff)
downloadrust-d85d82ab2234cf08e2e86575d0cdebefdb819831.tar.gz
rust-d85d82ab2234cf08e2e86575d0cdebefdb819831.zip
Implement Error for OccupiedError.
Diffstat (limited to 'library/std/src/error.rs')
-rw-r--r--library/std/src/error.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/library/std/src/error.rs b/library/std/src/error.rs
index 94338c7b04d..a7f744ce515 100644
--- a/library/std/src/error.rs
+++ b/library/std/src/error.rs
@@ -470,6 +470,24 @@ impl Error for char::DecodeUtf16Error {
     }
 }
 
+#[unstable(feature = "map_try_insert", issue = "none")]
+impl<'a, K: Debug + Ord, V: Debug> Error
+    for crate::collections::btree_map::OccupiedError<'a, K, V>
+{
+    #[allow(deprecated)]
+    fn description(&self) -> &str {
+        "key already exists"
+    }
+}
+
+#[unstable(feature = "map_try_insert", issue = "none")]
+impl<'a, K: Debug, V: Debug> Error for crate::collections::hash_map::OccupiedError<'a, K, V> {
+    #[allow(deprecated)]
+    fn description(&self) -> &str {
+        "key already exists"
+    }
+}
+
 #[stable(feature = "box_error", since = "1.8.0")]
 impl<T: Error> Error for Box<T> {
     #[allow(deprecated, deprecated_in_future)]