Comment

Comment by gilnaa

You put #[non_exhaustive] on a enum in Rust to force users matching on it to handle an "else"/"default" case, so that you can add more variants to this enum in the future without breaking their code.

It doesn't mean that the enum itself is non exhaustive: at any point in time when enum is defined, it defines all of its variants and any other value is still UB.

parent gilnaa 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton