From 97984d6eb9374c3c2a21ce92ad8c91dbf5787423 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 28 Nov 2019 20:14:28 -0800 Subject: [PATCH] Hide Error::description and cause methods Description has been documented as soft-deprecated since 1.27.0, cause has been documented as deprecated since 1.30.0 and has produced deprecation warnings since 1.33.0. There is no longer any reason to call or implement either of these methods. Now it's a year or a year and a half later and there is less and less reason over time to even know about either one. This commit adds #[doc(hidden)] to Error::description and Error::cause to keep them out of the standard library's API documentation. --- src/libstd/error.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstd/error.rs b/src/libstd/error.rs index ec1c444bcf8c8..8040a5323e726 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -67,6 +67,7 @@ pub trait Error: Debug + Display { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[doc(hidden)] fn description(&self) -> &str { "description() is deprecated; use Display" } @@ -132,6 +133,7 @@ pub trait Error: Debug + Display { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(since = "1.33.0", reason = "replaced by Error::source, which can support \ downcasting")] + #[doc(hidden)] fn cause(&self) -> Option<&dyn Error> { self.source() }