summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2018-04-22 19:17:08 +0100
committerKornel <kornel@geekhood.net>2018-04-25 21:54:33 +0100
commitf6a833a99a76e015cae0410f20af9f3767a14911 (patch)
tree6b678e6529a7e56f11f1f579f160db627b4560d2 /src/libstd
parenta5655b81a3bad56beaa161662177192681832532 (diff)
downloadrust-f6a833a99a76e015cae0410f20af9f3767a14911.tar.gz
rust-f6a833a99a76e015cae0410f20af9f3767a14911.zip
Suggest alternatives to Error::description()
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/error.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index 0954649653c..817eea5eaf1 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -58,6 +58,8 @@ pub trait Error: Debug + Display {
     /// new code should use [`Display`] instead
     /// and new `impl`s can omit it.
     ///
+    /// To obtain error description as a string, use `to_string()`.
+    ///
     /// [`Display`]: ../fmt/trait.Display.html
     ///
     /// # Examples
@@ -73,7 +75,7 @@ pub trait Error: Debug + Display {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     fn description(&self) -> &str {
-        ""
+        "description() is deprecated; use Display"
     }
 
     /// The lower-level cause of this error, if any.