mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Implement slice pattern AST > HIR lowering
This commit is contained in:
parent
3e1d97790b
commit
a3b104aa6d
8 changed files with 64 additions and 13 deletions
|
@ -393,7 +393,7 @@ pub enum Pat {
|
|||
},
|
||||
Slice {
|
||||
prefix: Vec<PatId>,
|
||||
rest: Option<PatId>,
|
||||
slice: Option<PatId>,
|
||||
suffix: Vec<PatId>,
|
||||
},
|
||||
Path(Path),
|
||||
|
@ -424,8 +424,8 @@ impl Pat {
|
|||
args.iter().copied().for_each(f);
|
||||
}
|
||||
Pat::Ref { pat, .. } => f(*pat),
|
||||
Pat::Slice { prefix, rest, suffix } => {
|
||||
let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter());
|
||||
Pat::Slice { prefix, slice, suffix } => {
|
||||
let total_iter = prefix.iter().chain(slice.iter()).chain(suffix.iter());
|
||||
total_iter.copied().for_each(f);
|
||||
}
|
||||
Pat::Record { args, .. } => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue