diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-11 21:46:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-11 21:46:36 +0000 |
commit | 759100fb0dcb41518f2a593dae5de5bbedd07776 (patch) | |
tree | 1889a546fdec52286157c2a1d8e11eca2c4883dc /crates/ra_hir_def/src/expr.rs | |
parent | af5042bd61877383398c17d941cf4f93f1c2d6be (diff) | |
parent | a3b104aa6df205e74c116d8c9e41900807924e70 (diff) |
Merge #3062
3062: Implement slice pattern AST > HIR lowering r=jplatte a=jplatte
WIP. The necessary changes for parsing are implemented, but actual inference is not yet. Just wanted to upload what I've got so far so it doesn't get duplicated :)
Will fix #3043
Co-authored-by: Jonas Platte <[email protected]>
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 5a84e08ed..9707c5527 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs | |||
@@ -394,7 +394,7 @@ pub enum Pat { | |||
394 | }, | 394 | }, |
395 | Slice { | 395 | Slice { |
396 | prefix: Vec<PatId>, | 396 | prefix: Vec<PatId>, |
397 | rest: Option<PatId>, | 397 | slice: Option<PatId>, |
398 | suffix: Vec<PatId>, | 398 | suffix: Vec<PatId>, |
399 | }, | 399 | }, |
400 | Path(Path), | 400 | Path(Path), |
@@ -425,8 +425,8 @@ impl Pat { | |||
425 | args.iter().copied().for_each(f); | 425 | args.iter().copied().for_each(f); |
426 | } | 426 | } |
427 | Pat::Ref { pat, .. } => f(*pat), | 427 | Pat::Ref { pat, .. } => f(*pat), |
428 | Pat::Slice { prefix, rest, suffix } => { | 428 | Pat::Slice { prefix, slice, suffix } => { |
429 | let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); | 429 | let total_iter = prefix.iter().chain(slice.iter()).chain(suffix.iter()); |
430 | total_iter.copied().for_each(f); | 430 | total_iter.copied().for_each(f); |
431 | } | 431 | } |
432 | Pat::Record { args, .. } => { | 432 | Pat::Record { args, .. } => { |