diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2018-04-04 16:03:46 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-04-12 22:53:13 +0200 |
| commit | b017742136a5d02b6ba0f2080e97d18a8bfeba4b (patch) | |
| tree | bce8f7a832eb5cb80d05a45ef5e562c274b0ff6b /src/libstd/error.rs | |
| parent | f9c96d70bd1471f662aa2ffdfe30ab6df69629d1 (diff) | |
| download | rust-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.rs | 11 |
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) |
