diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-15 08:10:16 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-15 08:10:16 +0100 |
commit | 2d79a1ad83cc39075c7c9e3230973013c8c58b17 (patch) | |
tree | e394007f715f8586c737db8f20f2d8f16f8913af /crates/ra_hir/src | |
parent | bcdba777bdc43762cff73ac3ded4ae737a503692 (diff) | |
parent | 0956323bb7b728da6bff4ad7241a542f4bb4e8e6 (diff) |
Merge #1848
1848: Parse `..` as a full pattern r=matklad a=ecstatic-morse
Resolves #1479.
This PR implements [RFC 2707](https://github.com/rust-lang/rfcs/pull/2707) in the parser. It introduces a new `DotDotPat` AST node modeled on `PlaceholderPat` and changes the parsing of tuple and slice patterns to conform to the RFC.
Notably, this PR does *not* change the resulting AST when `..` appears in a struct pattern (e.g. `Struct { a, b: c, .. }`). I *think* this is the behavior mandated by RFC 2707, but someone should confirm this.
Co-authored-by: Dylan MacKenzie <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/expr/lower.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs index 2be6f5421..61535d24f 100644 --- a/crates/ra_hir/src/expr/lower.rs +++ b/crates/ra_hir/src/expr/lower.rs | |||
@@ -573,6 +573,7 @@ where | |||
573 | } | 573 | } |
574 | 574 | ||
575 | // FIXME: implement | 575 | // FIXME: implement |
576 | ast::Pat::DotDotPat(_) => Pat::Missing, | ||
576 | ast::Pat::BoxPat(_) => Pat::Missing, | 577 | ast::Pat::BoxPat(_) => Pat::Missing, |
577 | ast::Pat::LiteralPat(_) => Pat::Missing, | 578 | ast::Pat::LiteralPat(_) => Pat::Missing, |
578 | ast::Pat::SlicePat(_) | ast::Pat::RangePat(_) => Pat::Missing, | 579 | ast::Pat::SlicePat(_) | ast::Pat::RangePat(_) => Pat::Missing, |