Skip to content

Commit 564a24c

Browse files
committed
Change std::error::Error trait documentation to talk about source instead of cause
1 parent 6ecad33 commit 564a24c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libstd/error.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ use string;
3030
/// themselves through the [`Display`] and [`Debug`] traits, and may provide
3131
/// cause chain information:
3232
///
33-
/// The [`cause`] method is generally used when errors cross "abstraction
34-
/// boundaries", i.e., when a one module must report an error that is "caused"
35-
/// by an error from a lower-level module. This setup makes it possible for the
36-
/// high-level module to provide its own errors that do not commit to any
37-
/// particular implementation, but also reveal some of its implementation for
38-
/// debugging via [`cause`] chains.
33+
/// The [`source`] method is generally used when errors cross "abstraction
34+
/// boundaries". If one module must report an error that is caused by an error
35+
/// from a lower-level module, it can allow access to that error via the
36+
/// [`source`] method. This makes it possible for the high-level module to
37+
/// provide its own errors while also revealing some of the implementation for
38+
/// debugging via [`source`] chains.
3939
///
4040
/// [`Result<T, E>`]: ../result/enum.Result.html
4141
/// [`Display`]: ../fmt/trait.Display.html
4242
/// [`Debug`]: ../fmt/trait.Debug.html
43-
/// [`cause`]: trait.Error.html#method.cause
43+
/// [`source`]: trait.Error.html#method.source
4444
#[stable(feature = "rust1", since = "1.0.0")]
4545
pub trait Error: Debug + Display {
4646
/// **This method is soft-deprecated.**

0 commit comments

Comments
 (0)