about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-05-28 19:52:16 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-05-28 19:52:16 +0530
commitfe9a91589ec5eb9e1a2cb1edc50be1f18c65fae5 (patch)
treec1cf8fde1eef116c1deb34ede7b1211e79115712 /src/libstd
parent81aeb0cddea5a614a4eebc0f0384fa27a7eb011f (diff)
parent394c23b084bcdfe8f45de194ebe77d4e06d4d5e9 (diff)
downloadrust-fe9a91589ec5eb9e1a2cb1edc50be1f18c65fae5.tar.gz
rust-fe9a91589ec5eb9e1a2cb1edc50be1f18c65fae5.zip
Rollup merge of #33856 - GuillaumeGomez:fmt_error, r=alexcrichton
Implement Error trait for fmt::Error type

Fixes #33827.

r? @alexcrichton

Just one last thing: I added a feature name, but don't hesitate to ask me to change it if you think it doesn't fit well.
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 d49d9764946..2a2d41112ff 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -212,6 +212,13 @@ impl<T: Error> Error for Box<T> {
     }
 }
 
+#[stable(feature = "fmt_error", since = "1.11.0")]
+impl Error for fmt::Error {
+    fn description(&self) -> &str {
+        "an error occurred when formatting an argument"
+    }
+}
+
 // copied from any.rs
 impl Error + 'static {
     /// Returns true if the boxed type is the same as `T`