aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-31 20:45:29 +0100
committerAleksey Kladov <[email protected]>2020-07-31 20:45:29 +0100
commit22d295ceaaee76dbd555cdeedc0ed7578e66279d (patch)
treeae48a497fbe6ef49c5b8a9a0431c778953c428a0 /crates/ra_hir_def/src
parent215b9b9cccd66c9e9413e7581931371daa0c94e5 (diff)
Rename DotDotPat -> RestPat
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 3f210547e..0d0365370 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -826,7 +826,7 @@ impl ExprCollector<'_> {
826 Pat::Missing 826 Pat::Missing
827 } 827 }
828 } 828 }
829 ast::Pat::DotDotPat(_) => { 829 ast::Pat::RestPat(_) => {
830 // `DotDotPat` requires special handling and should not be mapped 830 // `DotDotPat` 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 `DotDotPat` is mapped to `Pat`, which can easily happen
@@ -853,10 +853,10 @@ impl ExprCollector<'_> {
853 fn collect_tuple_pat(&mut self, args: AstChildren<ast::Pat>) -> (Vec<PatId>, Option<usize>) { 853 fn collect_tuple_pat(&mut self, args: AstChildren<ast::Pat>) -> (Vec<PatId>, Option<usize>) {
854 // Find the location of the `..`, if there is one. Note that we do not 854 // Find the location of the `..`, if there is one. Note that we do not
855 // consider the possiblity of there being multiple `..` here. 855 // consider the possiblity of there being multiple `..` here.
856 let ellipsis = args.clone().position(|p| matches!(p, ast::Pat::DotDotPat(_))); 856 let ellipsis = args.clone().position(|p| matches!(p, ast::Pat::RestPat(_)));
857 // We want to skip the `..` pattern here, since we account for it above. 857 // We want to skip the `..` pattern here, since we account for it above.
858 let args = args 858 let args = args
859 .filter(|p| !matches!(p, ast::Pat::DotDotPat(_))) 859 .filter(|p| !matches!(p, ast::Pat::RestPat(_)))
860 .map(|p| self.collect_pat(p)) 860 .map(|p| self.collect_pat(p))
861 .collect(); 861 .collect();
862 862