-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
Description
Summary
.
Lint Name
match_single_binding
Reproducer
I tried this code:
pub fn a() -> usize {
match 1 {
_ => (),
}
2
}
pub fn main() {}
Clippy will suggest
pub fn a() -> usize {
()
2
}
but this will not build
error: expected `;`, found `2`
--> src/main.rs:2:4
|
2 | ()
| ^ help: add `;` here
3 | 2
| - unexpected token
maybe we can make it ();
or just suggest removal of the entire match?
Version
rustc 1.69.0-nightly (b1719530f 2023-03-04)
binary: rustc
commit-hash: b1719530f44e3c8ec903f76020a52bd8764d5d10
commit-date: 2023-03-04
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied