News for hackers. Stuff that matters.
Re:Rust 1.50 by azornathogron on Thursday February 11, 2021 @12:23PM (#26104334)
For that use-case can you get away with just setting #[repr(i32)] on the enum and leaving Unknown out of the list?

I guess the compiler can't help you keep known and unknown values separate with that structure though, so maybe it's not enough.

Re:Rust 1.50 by kzrdude on Thursday February 11, 2021 @12:38PM (#26104583)
If you do that, then 3 etc is not a valid value for the enum. Only valid values for that type are the variants.