From 16d8d4b899c8f23456027d0baec6ed83d256507c Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 26 Aug 2020 22:41:56 +0800 Subject: [PATCH 1/3] Error use explicit intra-doc link and fix text --- library/std/src/error.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 84e686c2fef81..9869ccec54638 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -33,15 +33,14 @@ use crate::string; /// themselves through the [`Display`] and [`Debug`] traits, and may provide /// cause chain information: /// -/// The [`source`] method is generally used when errors cross "abstraction -/// boundaries". If one module must report an error that is caused by an error -/// from a lower-level module, it can allow access to that error via the -/// [`source`] method. This makes it possible for the high-level module to -/// provide its own errors while also revealing some of the implementation for -/// debugging via [`source`] chains. +/// The [`Error::source`] method is generally used when errors cross +/// "abstraction boundaries". If one module must report an error that is caused +/// by an error from a lower-level module, it can allow accessing that error +/// via the [`Error::source`] method. This makes it possible for the high-level +/// module to provide its own errors while also revealing some of the +/// implementation for debugging via [`Error::source`] chains. /// /// [`Result`]: Result -/// [`source`]: Error::source #[stable(feature = "rust1", since = "1.0.0")] pub trait Error: Debug + Display { /// The lower-level source of this error, if any. @@ -636,7 +635,7 @@ impl dyn Error { } /// Returns an iterator starting with the current error and continuing with - /// recursively calling [`source`]. + /// recursively calling [`Error::source`]. /// /// If you want to omit the current error and only use its sources, /// use `skip(1)`. @@ -686,8 +685,6 @@ impl dyn Error { /// assert!(iter.next().is_none()); /// assert!(iter.next().is_none()); /// ``` - /// - /// [`source`]: Error::source #[unstable(feature = "error_iter", issue = "58520")] #[inline] pub fn chain(&self) -> Chain<'_> { From 9ea45935728651e985d70649a476ad89d0bee15e Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 26 Aug 2020 23:21:44 +0800 Subject: [PATCH 2/3] Use [xxx()] rather than the [xxx] function Co-authored-by: Joshua Nelson --- library/std/src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 9869ccec54638..2c1aada8a4fab 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -33,10 +33,10 @@ use crate::string; /// themselves through the [`Display`] and [`Debug`] traits, and may provide /// cause chain information: /// -/// The [`Error::source`] method is generally used when errors cross +/// [`Error::source()`] is generally used when errors cross /// "abstraction boundaries". If one module must report an error that is caused /// by an error from a lower-level module, it can allow accessing that error -/// via the [`Error::source`] method. This makes it possible for the high-level +/// via [`Error::source()`]. This makes it possible for the high-level /// module to provide its own errors while also revealing some of the /// implementation for debugging via [`Error::source`] chains. /// From 3a814f3f579d94938ebdbbd7d4508236d7b64233 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Thu, 27 Aug 2020 23:30:15 +0800 Subject: [PATCH 3/3] Reduce duplicate doc link in error Co-authored-by: Joshua Nelson --- library/std/src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 2c1aada8a4fab..d3b0f8ceb68a6 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -38,7 +38,7 @@ use crate::string; /// by an error from a lower-level module, it can allow accessing that error /// via [`Error::source()`]. This makes it possible for the high-level /// module to provide its own errors while also revealing some of the -/// implementation for debugging via [`Error::source`] chains. +/// implementation for debugging via `source` chains. /// /// [`Result`]: Result #[stable(feature = "rust1", since = "1.0.0")]