diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-31 21:05:10 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-31 21:05:10 +0100 |
commit | 2346a28c638dc8fe945059b68126d268dd7fb690 (patch) | |
tree | 4cfe573d8d6c49c3f92f4a56e5fae3af2b37c1a0 /crates/ra_hir_def | |
parent | 1914d0aa7b5518c743e7403da6d7eea3fe28e955 (diff) | |
parent | 8cf19847ddbcbbe1c1bb634dfc4a61ab75ec941d (diff) |
Merge #5634
5634: Finish rename r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 0d0365370..f5c37edb3 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -496,7 +496,7 @@ impl ExprCollector<'_> { | |||
496 | self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr) | 496 | self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr) |
497 | } | 497 | } |
498 | ast::Expr::TupleExpr(e) => { | 498 | ast::Expr::TupleExpr(e) => { |
499 | let exprs = e.exprs().map(|expr| self.collect_expr(expr)).collect(); | 499 | let exprs = e.fields().map(|expr| self.collect_expr(expr)).collect(); |
500 | self.alloc_expr(Expr::Tuple { exprs }, syntax_ptr) | 500 | self.alloc_expr(Expr::Tuple { exprs }, syntax_ptr) |
501 | } | 501 | } |
502 | ast::Expr::BoxExpr(e) => { | 502 | ast::Expr::BoxExpr(e) => { |
@@ -762,7 +762,7 @@ impl ExprCollector<'_> { | |||
762 | } | 762 | } |
763 | ast::Pat::TupleStructPat(p) => { | 763 | ast::Pat::TupleStructPat(p) => { |
764 | let path = p.path().and_then(|path| self.expander.parse_path(path)); | 764 | let path = p.path().and_then(|path| self.expander.parse_path(path)); |
765 | let (args, ellipsis) = self.collect_tuple_pat(p.args()); | 765 | let (args, ellipsis) = self.collect_tuple_pat(p.fields()); |
766 | Pat::TupleStruct { path, args, ellipsis } | 766 | Pat::TupleStruct { path, args, ellipsis } |
767 | } | 767 | } |
768 | ast::Pat::RefPat(p) => { | 768 | ast::Pat::RefPat(p) => { |
@@ -780,7 +780,7 @@ impl ExprCollector<'_> { | |||
780 | } | 780 | } |
781 | ast::Pat::ParenPat(p) => return self.collect_pat_opt(p.pat()), | 781 | ast::Pat::ParenPat(p) => return self.collect_pat_opt(p.pat()), |
782 | ast::Pat::TuplePat(p) => { | 782 | ast::Pat::TuplePat(p) => { |
783 | let (args, ellipsis) = self.collect_tuple_pat(p.args()); | 783 | let (args, ellipsis) = self.collect_tuple_pat(p.fields()); |
784 | Pat::Tuple { args, ellipsis } | 784 | Pat::Tuple { args, ellipsis } |
785 | } | 785 | } |
786 | ast::Pat::WildcardPat(_) => Pat::Wild, | 786 | ast::Pat::WildcardPat(_) => Pat::Wild, |
@@ -809,7 +809,7 @@ impl ExprCollector<'_> { | |||
809 | ast::Pat::SlicePat(p) => { | 809 | ast::Pat::SlicePat(p) => { |
810 | let SlicePatComponents { prefix, slice, suffix } = p.components(); | 810 | let SlicePatComponents { prefix, slice, suffix } = p.components(); |
811 | 811 | ||
812 | // FIXME properly handle `DotDotPat` | 812 | // FIXME properly handle `RestPat` |
813 | Pat::Slice { | 813 | Pat::Slice { |
814 | prefix: prefix.into_iter().map(|p| self.collect_pat(p)).collect(), | 814 | prefix: prefix.into_iter().map(|p| self.collect_pat(p)).collect(), |
815 | slice: slice.map(|p| self.collect_pat(p)), | 815 | slice: slice.map(|p| self.collect_pat(p)), |
@@ -827,9 +827,9 @@ impl ExprCollector<'_> { | |||
827 | } | 827 | } |
828 | } | 828 | } |
829 | ast::Pat::RestPat(_) => { | 829 | ast::Pat::RestPat(_) => { |
830 | // `DotDotPat` requires special handling and should not be mapped | 830 | // `RestPat` requires special handling and should not be mapped |
831 | // to a Pat. Here we are using `Pat::Missing` as a fallback for | 831 | // to a Pat. Here we are using `Pat::Missing` as a fallback for |
832 | // when `DotDotPat` is mapped to `Pat`, which can easily happen | 832 | // when `RestPat` is mapped to `Pat`, which can easily happen |
833 | // when the source code being analyzed has a malformed pattern | 833 | // when the source code being analyzed has a malformed pattern |
834 | // which includes `..` in a place where it isn't valid. | 834 | // which includes `..` in a place where it isn't valid. |
835 | 835 | ||