Skip to content

Commit 8552a14

Browse files
committed
Add note about recommended forward usage
1 parent 78d9d99 commit 8552a14

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

impl/doc/error.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ A struct, enum, or enum variant can be annotated with `#[error(forward)]` to for
5252
the `source()` implementation to the source field (inferred or explicitly annotated),
5353
instead of returning the field itself.
5454

55+
In general this approach is only recommended if the error is intended to be fully
56+
transparent, and forwards implementation of [`Display`](crate::Display) as well.
57+
5558
### What works in `no_std`?
5659

5760
If you want to use the `Error` derive on `no_std` environments, then you need to

0 commit comments

Comments
 (0)