about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/error.rs19
-rw-r--r--src/libstd/lib.rs1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index f56e3a5d780..3d203429e7b 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -51,6 +51,7 @@
 // coherence challenge (e.g., specialization, neg impls, etc) we can
 // reconsider what crate these items belong in.
 
+use alloc::allocator;
 use any::TypeId;
 use cell;
 use char;
@@ -221,6 +222,24 @@ impl Error for ! {
     fn description(&self) -> &str { *self }
 }
 
+#[unstable(feature = "allocator_api",
+           reason = "the precise API and guarantees it provides may be tweaked.",
+           issue = "27700")]
+impl Error for allocator::AllocErr {
+    fn description(&self) -> &str {
+        allocator::AllocErr::description(self)
+    }
+}
+
+#[unstable(feature = "allocator_api",
+           reason = "the precise API and guarantees it provides may be tweaked.",
+           issue = "27700")]
+impl Error for allocator::CannotReallocInPlace {
+    fn description(&self) -> &str {
+        allocator::CannotReallocInPlace::description(self)
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Error for str::ParseBoolError {
     fn description(&self) -> &str { "failed to parse bool" }
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index f307fbb7c00..6938aefb522 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -245,6 +245,7 @@
 // std is implemented with unstable features, many of which are internal
 // compiler details that will never be stable
 #![feature(alloc)]
+#![feature(allocator_api)]
 #![feature(allow_internal_unstable)]
 #![feature(asm)]
 #![feature(associated_consts)]