about summary refs log tree commit diff
path: root/src/libstd/error.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-12-30 08:02:39 +0000
committerbors <bors@rust-lang.org>2014-12-30 08:02:39 +0000
commitd2368c3c11ddab9d812c4ddec2e44579326ad347 (patch)
treeb976bc0eb040da67646a9d99bb9b901cb9f55abd /src/libstd/error.rs
parentfea5aa656ff4349f4d3e1fea1447d26986762ae1 (diff)
parent470ae101d6e26a6ce07292b7fca6eaed527451c7 (diff)
downloadrust-d2368c3c11ddab9d812c4ddec2e44579326ad347.tar.gz
rust-d2368c3c11ddab9d812c4ddec2e44579326ad347.zip
auto merge of #20320 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/error.rs')
-rw-r--r--src/libstd/error.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index cd7d9aacc90..9a46a500a4b 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -81,6 +81,7 @@
 use prelude::*;
 
 use str::Utf8Error;
+use string::{FromUtf8Error, FromUtf16Error};
 
 /// Base functionality for all errors in Rust.
 pub trait Error: Send {
@@ -117,3 +118,12 @@ impl Error for Utf8Error {
 
     fn detail(&self) -> Option<String> { Some(self.to_string()) }
 }
+
+impl Error for FromUtf8Error {
+    fn description(&self) -> &str { "invalid utf-8" }
+    fn detail(&self) -> Option<String> { Some(self.to_string()) }
+}
+
+impl Error for FromUtf16Error {
+    fn description(&self) -> &str { "invalid utf-16" }
+}