News for hackers. Stuff that matters.
Re:API design note: Beware of adding an "Other" enum value by sunshowers on Sunday March 02, 2025 @04:29PM (#43235348)
There is currently a missing middle ground in stable Rust, which is to lint on a missing variant rather than fail compilation. There's an unstable option for it, but it would be very useful for non-exhaustive enums where consumers care about matching against every known variant.

You can practically use it today by gating on a nightly-only cfg flag. See https://github.com/guppy-rs/guppy/blob/fa61210b67bea233de52c... and https://github.com/guppy-rs/guppy/blob/fa61210b67bea233de52c...

Re:API design note: Beware of adding an "Other" enum value by eru on Sunday March 02, 2025 @06:57PM (#43236670)
Couldn't clippy do that for you?
Re:API design note: Beware of adding an "Other" enum value by sunshowers on Sunday March 02, 2025 @07:08PM (#43236746)
Not at the moment. The unstable lint is implemented in rustc directly, not in clippy, though I guess it could move to clippy in the future.