aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr/validation.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-23 13:55:21 +0100
committerAleksey Kladov <[email protected]>2019-08-23 14:59:50 +0100
commit5b18a4eef9e69260ce2f105b33553c929cb7d827 (patch)
tree15f55b3eab48c3d0bbb1975fbd4db7cbb56d3e3e /crates/ra_hir/src/expr/validation.rs
parentc12dce0073c1766f7d2b10a69f8526a8093e70dc (diff)
rename struct -> record, pos -> tuple
Diffstat (limited to 'crates/ra_hir/src/expr/validation.rs')
-rw-r--r--crates/ra_hir/src/expr/validation.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs
index 82a06ca25..62f7d41f5 100644
--- a/crates/ra_hir/src/expr/validation.rs
+++ b/crates/ra_hir/src/expr/validation.rs
@@ -1,9 +1,9 @@
1use rustc_hash::FxHashSet; 1use rustc_hash::FxHashSet;
2use std::sync::Arc; 2use std::sync::Arc;
3 3
4use ra_syntax::ast::{AstNode, StructLit}; 4use ra_syntax::ast::{AstNode, RecordLit};
5 5
6use super::{Expr, ExprId, StructLitField}; 6use super::{Expr, ExprId, RecordLitField};
7use crate::{ 7use crate::{
8 adt::AdtDef, 8 adt::AdtDef,
9 diagnostics::{DiagnosticSink, MissingFields}, 9 diagnostics::{DiagnosticSink, MissingFields},
@@ -30,17 +30,17 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
30 pub(crate) fn validate_body(&mut self, db: &impl HirDatabase) { 30 pub(crate) fn validate_body(&mut self, db: &impl HirDatabase) {
31 let body = self.func.body(db); 31 let body = self.func.body(db);
32 for e in body.exprs() { 32 for e in body.exprs() {
33 if let (id, Expr::StructLit { path, fields, spread }) = e { 33 if let (id, Expr::RecordLit { path, fields, spread }) = e {
34 self.validate_struct_literal(id, path, fields, *spread, db); 34 self.validate_record_literal(id, path, fields, *spread, db);
35 } 35 }
36 } 36 }
37 } 37 }
38 38
39 fn validate_struct_literal( 39 fn validate_record_literal(
40 &mut self, 40 &mut self,
41 id: ExprId, 41 id: ExprId,
42 _path: &Option<Path>, 42 _path: &Option<Path>,
43 fields: &[StructLitField], 43 fields: &[RecordLitField],
44 spread: Option<ExprId>, 44 spread: Option<ExprId>,
45 db: &impl HirDatabase, 45 db: &impl HirDatabase,
46 ) { 46 ) {
@@ -76,8 +76,8 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
76 if let Some(field_list_node) = source_map 76 if let Some(field_list_node) = source_map
77 .expr_syntax(id) 77 .expr_syntax(id)
78 .map(|ptr| ptr.to_node(source_file.syntax())) 78 .map(|ptr| ptr.to_node(source_file.syntax()))
79 .and_then(StructLit::cast) 79 .and_then(RecordLit::cast)
80 .and_then(|lit| lit.named_field_list()) 80 .and_then(|lit| lit.record_field_list())
81 { 81 {
82 let field_list_ptr = AstPtr::new(&field_list_node); 82 let field_list_ptr = AstPtr::new(&field_list_node);
83 self.sink.push(MissingFields { 83 self.sink.push(MissingFields {