Unverified Commit c35f0f1c authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Add `#[non_exhaustive]` to example actionable error in RFC (#1883)

parent 16e34a5d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -233,6 +233,8 @@ Actionable errors are represented as enums. If an error variant has an error sou
information, it must use a separate context struct that is referenced via tuple in the enum. For example:

```rust
// Good: new error types can be added in the future
#[non_exhaustive]
pub enum Error {
    // Good: This is exhaustive and uses a tuple, but its sole member is an extensible struct with private fields
    VariantA(VariantA),