Closed
Description
Suppose I've written code like:
enum Foo {
Bar { bar: u32 },
Baz,
}
fn is_bar(foo: &Foo) -> bool {
match foo {
&Foo::Bar { bar } => true,
&Foo::Baz => false,
}
}
The bar
variable is unused, and the error message I get looks like:
warning: unused variable: `bar`
--> src/main.rs:37:21
|
37 | &Foo::Bar { bar } => true,
| ^^^ help: consider using `_bar` instead
|
= note: #[warn(unused_variables)] on by default
The help is incorrect; _bar
is invalid. It should suggest replacing bar
with bar: _