diff options
author | Jonas Platte <[email protected]> | 2020-02-11 21:33:11 +0000 |
---|---|---|
committer | Jonas Platte <[email protected]> | 2020-02-11 21:33:11 +0000 |
commit | a3b104aa6df205e74c116d8c9e41900807924e70 (patch) | |
tree | ac3cb2695fba41813b70cadee3e624f71dfa2fd3 /crates/ra_hir_def/src/expr.rs | |
parent | 3e1d97790be166f8735607c552a94a28ab9b09b8 (diff) |
Implement slice pattern AST > HIR lowering
Diffstat (limited to 'crates/ra_hir_def/src/expr.rs')
-rw-r--r-- | crates/ra_hir_def/src/expr.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index a75ef9970..035824403 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs | |||
@@ -393,7 +393,7 @@ pub enum Pat { | |||
393 | }, | 393 | }, |
394 | Slice { | 394 | Slice { |
395 | prefix: Vec<PatId>, | 395 | prefix: Vec<PatId>, |
396 | rest: Option<PatId>, | 396 | slice: Option<PatId>, |
397 | suffix: Vec<PatId>, | 397 | suffix: Vec<PatId>, |
398 | }, | 398 | }, |
399 | Path(Path), | 399 | Path(Path), |
@@ -424,8 +424,8 @@ impl Pat { | |||
424 | args.iter().copied().for_each(f); | 424 | args.iter().copied().for_each(f); |
425 | } | 425 | } |
426 | Pat::Ref { pat, .. } => f(*pat), | 426 | Pat::Ref { pat, .. } => f(*pat), |
427 | Pat::Slice { prefix, rest, suffix } => { | 427 | Pat::Slice { prefix, slice, suffix } => { |
428 | let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); | 428 | let total_iter = prefix.iter().chain(slice.iter()).chain(suffix.iter()); |
429 | total_iter.copied().for_each(f); | 429 | total_iter.copied().for_each(f); |
430 | } | 430 | } |
431 | Pat::Record { args, .. } => { | 431 | Pat::Record { args, .. } => { |