about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2020-08-28 10:24:00 +0200
committerGitHub <noreply@github.com>2020-08-28 10:24:00 +0200
commitcbe3aef5592593f5b9e9d7af16ccfb488c8d2418 (patch)
treecec0714fc06e7e3dcbe166a01d3f96f36a4c7243
parentbe1b304ea4dec58255d76eca98442270ef17578a (diff)
parent3a814f3f579d94938ebdbbd7d4508236d7b64233 (diff)
downloadrust-cbe3aef5592593f5b9e9d7af16ccfb488c8d2418.tar.gz
rust-cbe3aef5592593f5b9e9d7af16ccfb488c8d2418.zip
Rollup merge of #75946 - pickfire:patch-8, r=jyn514
Error use explicit intra-doc link and fix text

Follow up of https://github.com/rust-lang/rust/pull/75629

r? @jyn514
-rw-r--r--library/std/src/error.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/library/std/src/error.rs b/library/std/src/error.rs
index 84e686c2fef..d3b0f8ceb68 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.
+/// [`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 [`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 `source` chains.
 ///
 /// [`Result<T, E>`]: 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<'_> {