Hacker News new | ask | show | jobs
by Nemo157 2379 days 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...

1 comments

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