about summary refs log tree commit diff
path: root/src/libstd/error.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-04-04 16:03:46 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-04-12 22:53:13 +0200
commitb017742136a5d02b6ba0f2080e97d18a8bfeba4b (patch)
treebce8f7a832eb5cb80d05a45ef5e562c274b0ff6b /src/libstd/error.rs
parentf9c96d70bd1471f662aa2ffdfe30ab6df69629d1 (diff)
downloadrust-b017742136a5d02b6ba0f2080e97d18a8bfeba4b.tar.gz
rust-b017742136a5d02b6ba0f2080e97d18a8bfeba4b.zip
Return Result instead of Option in alloc::Layout constructors
Diffstat (limited to 'src/libstd/error.rs')
-rw-r--r--src/libstd/error.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index ec55a3c021a..3c209928d43 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -57,7 +57,7 @@ use cell;
 use char;
 use core::array;
 use fmt::{self, Debug, Display};
-use heap::{AllocErr, CannotReallocInPlace};
+use heap::{AllocErr, LayoutErr, CannotReallocInPlace};
 use mem::transmute;
 use num;
 use str;
@@ -250,6 +250,15 @@ impl Error for AllocErr {
 #[unstable(feature = "allocator_api",
            reason = "the precise API and guarantees it provides may be tweaked.",
            issue = "32838")]
+impl Error for LayoutErr {
+    fn description(&self) -> &str {
+        "invalid parameters to Layout::from_size_align"
+    }
+}
+
+#[unstable(feature = "allocator_api",
+           reason = "the precise API and guarantees it provides may be tweaked.",
+           issue = "32838")]
 impl Error for CannotReallocInPlace {
     fn description(&self) -> &str {
         CannotReallocInPlace::description(self)