From 8552a1419a0fb16c4b480ffdf0bea446150ea834 Mon Sep 17 00:00:00 2001 From: MegaBluejay Date: Tue, 15 Aug 2023 12:43:20 +0300 Subject: [PATCH] Add note about recommended forward usage --- impl/doc/error.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/impl/doc/error.md b/impl/doc/error.md index f49a335d..5632eb2f 100644 --- a/impl/doc/error.md +++ b/impl/doc/error.md @@ -52,6 +52,9 @@ A struct, enum, or enum variant can be annotated with `#[error(forward)]` to for the `source()` implementation to the source field (inferred or explicitly annotated), instead of returning the field itself. +In general this approach is only recommended if the error is intended to be fully +transparent, and forwards implementation of [`Display`](crate::Display) as well. + ### What works in `no_std`? If you want to use the `Error` derive on `no_std` environments, then you need to