Skip to content

Commit 8a12ccf

Browse files
committed
Clarify Display for error should not include source
1 parent ce6daf3 commit 8a12ccf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/core/src/error.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ use crate::fmt::{self, Debug, Display, Formatter};
1919
/// Errors may provide cause information. [`Error::source()`] is generally
2020
/// used when errors cross "abstraction boundaries". If one module must report
2121
/// an error that is caused by an error from a lower-level module, it can allow
22-
/// accessing that error via [`Error::source()`]. This makes it possible for the
22+
/// accessing that error via `Error::source()`. This makes it possible for the
2323
/// high-level module to provide its own errors while also revealing some of the
2424
/// implementation for debugging.
2525
///
26+
/// `Display` for an error should not typically include information from `Error::source()`:
27+
/// error stack can be printed by external utilities.
28+
///
2629
/// # Example
2730
///
2831
/// Implementing the `Error` trait only requires that `Debug` and `Display` are implemented too.

0 commit comments

Comments
 (0)