diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/expr/lower.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 17e89c48f..bfd250f38 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -472,7 +472,7 @@ pub enum Pat { | |||
472 | Missing, | 472 | Missing, |
473 | Wild, | 473 | Wild, |
474 | Tuple(Vec<PatId>), | 474 | Tuple(Vec<PatId>), |
475 | Struct { | 475 | Record { |
476 | path: Option<Path>, | 476 | path: Option<Path>, |
477 | args: Vec<RecordFieldPat>, | 477 | args: Vec<RecordFieldPat>, |
478 | // FIXME: 'ellipsis' option | 478 | // FIXME: 'ellipsis' option |
@@ -518,7 +518,7 @@ impl Pat { | |||
518 | let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); | 518 | let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); |
519 | total_iter.copied().for_each(f); | 519 | total_iter.copied().for_each(f); |
520 | } | 520 | } |
521 | Pat::Struct { args, .. } => { | 521 | Pat::Record { args, .. } => { |
522 | args.iter().map(|f| f.pat).for_each(f); | 522 | args.iter().map(|f| f.pat).for_each(f); |
523 | } | 523 | } |
524 | } | 524 | } |
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs index 01b770149..f6a75a379 100644 --- a/crates/ra_hir/src/expr/lower.rs +++ b/crates/ra_hir/src/expr/lower.rs | |||
@@ -20,9 +20,8 @@ use crate::{ | |||
20 | }; | 20 | }; |
21 | 21 | ||
22 | use super::{ | 22 | use super::{ |
23 | ArithOp, Array, BinaryOp, BindingAnnotation, Body, BodySourceMap, CmpOp, Expr, ExprId, | 23 | ArithOp, Array, BinaryOp, BindingAnnotation, Body, BodySourceMap, CmpOp, Expr, ExprId, Literal, |
24 | Literal, LogicOp, MatchArm, Ordering, Pat, PatId, PatPtr, RecordFieldPat, RecordLitField, | 24 | LogicOp, MatchArm, Ordering, Pat, PatId, PatPtr, RecordFieldPat, RecordLitField, Statement, |
25 | Statement, | ||
26 | }; | 25 | }; |
27 | 26 | ||
28 | pub(crate) struct ExprCollector<DB> { | 27 | pub(crate) struct ExprCollector<DB> { |
@@ -504,7 +503,7 @@ where | |||
504 | }); | 503 | }); |
505 | fields.extend(iter); | 504 | fields.extend(iter); |
506 | 505 | ||
507 | Pat::Struct { path, args: fields } | 506 | Pat::Record { path, args: fields } |
508 | } | 507 | } |
509 | 508 | ||
510 | // FIXME: implement | 509 | // FIXME: implement |
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 9ba146299..12d7bb174 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -749,7 +749,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
749 | let is_non_ref_pat = match &body[pat] { | 749 | let is_non_ref_pat = match &body[pat] { |
750 | Pat::Tuple(..) | 750 | Pat::Tuple(..) |
751 | | Pat::TupleStruct { .. } | 751 | | Pat::TupleStruct { .. } |
752 | | Pat::Struct { .. } | 752 | | Pat::Record { .. } |
753 | | Pat::Range { .. } | 753 | | Pat::Range { .. } |
754 | | Pat::Slice { .. } => true, | 754 | | Pat::Slice { .. } => true, |
755 | // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. | 755 | // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. |
@@ -809,7 +809,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
809 | Pat::TupleStruct { path: ref p, args: ref subpats } => { | 809 | Pat::TupleStruct { path: ref p, args: ref subpats } => { |
810 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) | 810 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) |
811 | } | 811 | } |
812 | Pat::Struct { path: ref p, args: ref fields } => { | 812 | Pat::Record { path: ref p, args: ref fields } => { |
813 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) | 813 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) |
814 | } | 814 | } |
815 | Pat::Path(path) => { | 815 | Pat::Path(path) => { |