top | item 21842951

(no title)

Nemo157 | 6 years ago

non_exhaustive only affects downstream code, within the crate you can still treat it exhaustively. For example in this playground[0] if you build in test mode the match works inside the crate, but fails in the doc-test because that is treated as external code.

[0]: https://play.rust-lang.org/?version=stable&mode=debug&editio...

discuss

order

est31|6 years ago

Oh that's an interesting point, I didn't know that. I guess I'll use #[non_exhaustive] then after all.