diff options
Diffstat (limited to 'crates/ra_hir_ty/src/expr.rs')
-rw-r--r-- | crates/ra_hir_ty/src/expr.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs index fd59f4320..f04968e14 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/expr.rs | |||
@@ -24,7 +24,7 @@ pub use hir_def::{ | |||
24 | ArithOp, Array, BinaryOp, BindingAnnotation, CmpOp, Expr, ExprId, Literal, LogicOp, | 24 | ArithOp, Array, BinaryOp, BindingAnnotation, CmpOp, Expr, ExprId, Literal, LogicOp, |
25 | MatchArm, Ordering, Pat, PatId, RecordFieldPat, RecordLitField, Statement, UnaryOp, | 25 | MatchArm, Ordering, Pat, PatId, RecordFieldPat, RecordLitField, Statement, UnaryOp, |
26 | }, | 26 | }, |
27 | LocalStructFieldId, VariantId, | 27 | LocalFieldId, VariantId, |
28 | }; | 28 | }; |
29 | 29 | ||
30 | pub struct ExprValidator<'a, 'b: 'a> { | 30 | pub struct ExprValidator<'a, 'b: 'a> { |
@@ -83,7 +83,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
83 | id: ExprId, | 83 | id: ExprId, |
84 | db: &dyn HirDatabase, | 84 | db: &dyn HirDatabase, |
85 | variant_def: VariantId, | 85 | variant_def: VariantId, |
86 | missed_fields: Vec<LocalStructFieldId>, | 86 | missed_fields: Vec<LocalFieldId>, |
87 | ) { | 87 | ) { |
88 | // XXX: only look at source_map if we do have missing fields | 88 | // XXX: only look at source_map if we do have missing fields |
89 | let (_, source_map) = db.body_with_source_map(self.func.into()); | 89 | let (_, source_map) = db.body_with_source_map(self.func.into()); |
@@ -112,7 +112,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
112 | id: PatId, | 112 | id: PatId, |
113 | db: &dyn HirDatabase, | 113 | db: &dyn HirDatabase, |
114 | variant_def: VariantId, | 114 | variant_def: VariantId, |
115 | missed_fields: Vec<LocalStructFieldId>, | 115 | missed_fields: Vec<LocalFieldId>, |
116 | ) { | 116 | ) { |
117 | // XXX: only look at source_map if we do have missing fields | 117 | // XXX: only look at source_map if we do have missing fields |
118 | let (_, source_map) = db.body_with_source_map(self.func.into()); | 118 | let (_, source_map) = db.body_with_source_map(self.func.into()); |
@@ -256,7 +256,7 @@ pub fn record_literal_missing_fields( | |||
256 | infer: &InferenceResult, | 256 | infer: &InferenceResult, |
257 | id: ExprId, | 257 | id: ExprId, |
258 | expr: &Expr, | 258 | expr: &Expr, |
259 | ) -> Option<(VariantId, Vec<LocalStructFieldId>, /*exhaustive*/ bool)> { | 259 | ) -> Option<(VariantId, Vec<LocalFieldId>, /*exhaustive*/ bool)> { |
260 | let (fields, exhausitve) = match expr { | 260 | let (fields, exhausitve) = match expr { |
261 | Expr::RecordLit { path: _, fields, spread } => (fields, spread.is_none()), | 261 | Expr::RecordLit { path: _, fields, spread } => (fields, spread.is_none()), |
262 | _ => return None, | 262 | _ => return None, |
@@ -270,7 +270,7 @@ pub fn record_literal_missing_fields( | |||
270 | let variant_data = variant_data(db.upcast(), variant_def); | 270 | let variant_data = variant_data(db.upcast(), variant_def); |
271 | 271 | ||
272 | let specified_fields: FxHashSet<_> = fields.iter().map(|f| &f.name).collect(); | 272 | let specified_fields: FxHashSet<_> = fields.iter().map(|f| &f.name).collect(); |
273 | let missed_fields: Vec<LocalStructFieldId> = variant_data | 273 | let missed_fields: Vec<LocalFieldId> = variant_data |
274 | .fields() | 274 | .fields() |
275 | .iter() | 275 | .iter() |
276 | .filter_map(|(f, d)| if specified_fields.contains(&d.name) { None } else { Some(f) }) | 276 | .filter_map(|(f, d)| if specified_fields.contains(&d.name) { None } else { Some(f) }) |
@@ -286,7 +286,7 @@ pub fn record_pattern_missing_fields( | |||
286 | infer: &InferenceResult, | 286 | infer: &InferenceResult, |
287 | id: PatId, | 287 | id: PatId, |
288 | pat: &Pat, | 288 | pat: &Pat, |
289 | ) -> Option<(VariantId, Vec<LocalStructFieldId>, /*exhaustive*/ bool)> { | 289 | ) -> Option<(VariantId, Vec<LocalFieldId>, /*exhaustive*/ bool)> { |
290 | let (fields, exhaustive) = match pat { | 290 | let (fields, exhaustive) = match pat { |
291 | Pat::Record { path: _, args, ellipsis } => (args, !ellipsis), | 291 | Pat::Record { path: _, args, ellipsis } => (args, !ellipsis), |
292 | _ => return None, | 292 | _ => return None, |
@@ -300,7 +300,7 @@ pub fn record_pattern_missing_fields( | |||
300 | let variant_data = variant_data(db.upcast(), variant_def); | 300 | let variant_data = variant_data(db.upcast(), variant_def); |
301 | 301 | ||
302 | let specified_fields: FxHashSet<_> = fields.iter().map(|f| &f.name).collect(); | 302 | let specified_fields: FxHashSet<_> = fields.iter().map(|f| &f.name).collect(); |
303 | let missed_fields: Vec<LocalStructFieldId> = variant_data | 303 | let missed_fields: Vec<LocalFieldId> = variant_data |
304 | .fields() | 304 | .fields() |
305 | .iter() | 305 | .iter() |
306 | .filter_map(|(f, d)| if specified_fields.contains(&d.name) { None } else { Some(f) }) | 306 | .filter_map(|(f, d)| if specified_fields.contains(&d.name) { None } else { Some(f) }) |