mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
handle match scrutinee in closure captures
This commit is contained in:
parent
e8ae2d3976
commit
c5ea2d7adc
8 changed files with 137 additions and 10 deletions
|
@ -221,15 +221,15 @@ impl Body {
|
|||
|
||||
pub fn walk_bindings_in_pat(&self, pat_id: PatId, mut f: impl FnMut(BindingId)) {
|
||||
self.walk_pats(pat_id, &mut |pat| {
|
||||
if let Pat::Bind { id, .. } = pat {
|
||||
if let Pat::Bind { id, .. } = &self[pat] {
|
||||
f(*id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
pub fn walk_pats(&self, pat_id: PatId, f: &mut impl FnMut(&Pat)) {
|
||||
pub fn walk_pats(&self, pat_id: PatId, f: &mut impl FnMut(PatId)) {
|
||||
let pat = &self[pat_id];
|
||||
f(pat);
|
||||
f(pat_id);
|
||||
match pat {
|
||||
Pat::Range { .. }
|
||||
| Pat::Lit(..)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue