We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ee9110 commit a0e7651Copy full SHA for a0e7651
idioms/priv-extend.md
@@ -38,3 +38,4 @@ You can use the `()` type so that there is no runtime overhead and prepend `_` t
38
If Rust allowed private variants of enums, we could use the same trick to make adding a variant to an enum backwards compatible.
39
The problem there is exhaustive match expressions.
40
A private variant would force clients to have a `_` wildcard pattern.
41
+A common way to implement this instead is using the [#[non_exhaustive]](https://doc.rust-lang.org/reference/attributes/type_system.html) attribute.
0 commit comments