Open
Description
Summary
a suggestion from the match_single_binding
lint includes invalid syntax
posted here but later thought "people with notifications for new issues won't notice that"
could be fixed by #15060
Reproducer
I tried this code:
fn what(a: usize, b: usize, c: usize) -> bool {
a < b
&& match b {
b => b < c,
}
}
I expected to see this happen:
match_single_binding suggests something like this:
fn what(a: usize, b: usize, c: usize) -> bool {
a < b
&& b < c
}
Instead, this happened:
match_single_binding suggests this:
fn what(a: usize, b: usize, c: usize) -> bool {
a < b
&& let b = b;
b < c
}
Version
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: x86_64-unknown-linux-gnu
release: 1.88.0
LLVM version: 20.1.5
Additional Labels
@rustbot label +I-suggestion-causes-bug