Open
Description
rust-analyzer version: v0.3.1916 (taken from the VSCode plugin page, the given command does nothing on my machine)
rustc version: 1.76.0 (07dca489a 2024-02-04)
editor or extension: VSCode with rust-analyzer v0.3.1916
relevant settings: NA
repository link (if public, optional): NA
code snippet to reproduce:
pub trait Foo {
type Bar;
fn foo(bar: Self::Bar);
}
pub struct FooImpl;
const foo_impl: () = {
impl Foo for FooImpl {
type Bar = ();
fn foo(_bar: Self::Bar) {
let () = _bar; // non-exhaustive pattern: `_` not covered reported here
}
}
};
This code compiles fine with rustc.
Any of the following changes make the error go away:
- Renaming
_bar
bybar
- Replacing
fn foo(_bar: Self::Bar)
byfn foo(_bar: ())
- Removing the
const foo_impl: () = {...}
wrapper
The original issue for me is when using proptest_derive, I get the error with this code:
#[derive(Arbitrary)]
pub enum Foo {
Bar,
Baz
}
The generated code looks similar to the repro above.