about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorLena Wildervanck <Lena.Wildervanck@gmail.com>2020-03-06 10:29:11 +0100
committerLena Wildervanck <Lena.Wildervanck@gmail.com>2020-03-07 00:59:25 +0100
commitb900de0f778c4b66921a71824ed7745724405f45 (patch)
tree89637061fc53218296e41f2d9736e9b614dfb06a /src/libstd
parent4a1b69d53aeb59a83de192ea67dbe4707b9a7b73 (diff)
downloadrust-b900de0f778c4b66921a71824ed7745724405f45.tar.gz
rust-b900de0f778c4b66921a71824ed7745724405f45.zip
Implement Error for TryReserveError
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/error.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index b480581e21b..61944edf142 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -552,6 +552,13 @@ impl Error for char::ParseCharError {
     }
 }
 
+#[unstable(feature = "try_reserve", reason = "new API", issue = "48043")]
+impl Error for alloc::collections::TryReserveError {
+    fn description(&self) -> &str {
+        "memory allocation failed"
+    }
+}
+
 // Copied from `any.rs`.
 impl dyn Error + 'static {
     /// Returns `true` if the boxed type is the same as `T`