about summary refs log tree commit diff
path: root/src/libstd/net
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-25 21:10:49 +0000
committerbors <bors@rust-lang.org>2019-12-25 21:10:49 +0000
commitbbf13723bc22f1a850438bf0b103d09e474a1ef5 (patch)
treeb216df9683f22b67e770aee33a2828c0d2559a62 /src/libstd/net
parented33453a37d602f34cc40c205f9b9b8a8aff88b5 (diff)
parent4646a88b7a1e68326d092b9cbbbbdd616a51077f (diff)
downloadrust-bbf13723bc22f1a850438bf0b103d09e474a1ef5.tar.gz
rust-bbf13723bc22f1a850438bf0b103d09e474a1ef5.zip
Auto merge of #66919 - dtolnay:description, r=KodrAus
Deprecate Error::description for real

`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it.

This PR:

- adds `#[rustc_deprecated(since = "1.41.0")]` to `Error::description`;
- moves `description` (and `cause`, which is also deprecated) below the `source` and `backtrace` methods in the Error trait;
- reduces documentation of `description` and `cause` to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call `description`;
- removes the description function of all *currently unstable* Error impls in the standard library;
- marks `#[allow(deprecated)]` the description function of all *stable* Error impls in the standard library;
- replaces miscellaneous uses of `description` in example code and the compiler.

---

![description](https://user-images.githubusercontent.com/1940490/69910369-3bbaca80-13bf-11ea-94f7-2fe27a7ea333.png)
Diffstat (limited to 'src/libstd/net')
-rw-r--r--src/libstd/net/parser.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/net/parser.rs b/src/libstd/net/parser.rs
index c81506215c1..868a7e261c4 100644
--- a/src/libstd/net/parser.rs
+++ b/src/libstd/net/parser.rs
@@ -363,6 +363,7 @@ pub struct AddrParseError(());
 
 #[stable(feature = "addr_parse_error_error", since = "1.4.0")]
 impl fmt::Display for AddrParseError {
+    #[allow(deprecated, deprecated_in_future)]
     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt.write_str(self.description())
     }
@@ -370,6 +371,7 @@ impl fmt::Display for AddrParseError {
 
 #[stable(feature = "addr_parse_error_error", since = "1.4.0")]
 impl Error for AddrParseError {
+    #[allow(deprecated)]
     fn description(&self) -> &str {
         "invalid IP address syntax"
     }