proptest-rs / proptest

Hypothesis-like property testing for Rust
Apache License 2.0
1.63k stars 152 forks source link

rust-analyzer doesn't like the derive(Arbitrary) generated code for enums #444

Closed avandecreme closed 1 week ago

avandecreme commented 2 months ago

The following code get a non-exhaustive pattern error from rust-analyzer but compiles fine with rustc

#[derive(Arbitrary)] // non-exhaustive pattern: `_` not covered reported here
pub enum Foo {
    Bar,
    Baz
}

I think this is a rust-analyzer bug, so I opened https://github.com/rust-lang/rust-analyzer/issues/17031

However, proptest_derive could use one of the workaround I listed in the rust-analyzer issue.

avandecreme commented 1 week ago

This is fixed in the latest version of proptest.