diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 15:21:30 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 15:21:30 +0100 |
commit | 6f8aa75329d0a4e588e58b8f22f7932bf3d3a706 (patch) | |
tree | 9bf4ba410b86ee0b262ce1b0379bbf8dc64b07e6 /crates/ra_hir_ty | |
parent | 98ec5f2c21d0072e4811309ac111db75b87146d1 (diff) |
Rename RecordLit -> RecordExpr
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/expr.rs | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 885abbaf2..f210c305a 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -29,7 +29,7 @@ pub fn validate_body(db: &dyn HirDatabase, owner: DefWithBodyId, sink: &mut Diag | |||
29 | #[derive(Debug)] | 29 | #[derive(Debug)] |
30 | pub struct NoSuchField { | 30 | pub struct NoSuchField { |
31 | pub file: HirFileId, | 31 | pub file: HirFileId, |
32 | pub field: AstPtr<ast::RecordField>, | 32 | pub field: AstPtr<ast::RecordExprField>, |
33 | } | 33 | } |
34 | 34 | ||
35 | impl Diagnostic for NoSuchField { | 35 | impl Diagnostic for NoSuchField { |
@@ -47,19 +47,19 @@ impl Diagnostic for NoSuchField { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | impl AstDiagnostic for NoSuchField { | 49 | impl AstDiagnostic for NoSuchField { |
50 | type AST = ast::RecordField; | 50 | type AST = ast::RecordExprField; |
51 | 51 | ||
52 | fn ast(&self, db: &dyn AstDatabase) -> Self::AST { | 52 | fn ast(&self, db: &dyn AstDatabase) -> Self::AST { |
53 | let root = db.parse_or_expand(self.source().file_id).unwrap(); | 53 | let root = db.parse_or_expand(self.source().file_id).unwrap(); |
54 | let node = self.source().value.to_node(&root); | 54 | let node = self.source().value.to_node(&root); |
55 | ast::RecordField::cast(node).unwrap() | 55 | ast::RecordExprField::cast(node).unwrap() |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | #[derive(Debug)] | 59 | #[derive(Debug)] |
60 | pub struct MissingFields { | 60 | pub struct MissingFields { |
61 | pub file: HirFileId, | 61 | pub file: HirFileId, |
62 | pub field_list: AstPtr<ast::RecordFieldList>, | 62 | pub field_list: AstPtr<ast::RecordExprFieldList>, |
63 | pub missed_fields: Vec<Name>, | 63 | pub missed_fields: Vec<Name>, |
64 | } | 64 | } |
65 | 65 | ||
@@ -80,12 +80,12 @@ impl Diagnostic for MissingFields { | |||
80 | } | 80 | } |
81 | 81 | ||
82 | impl AstDiagnostic for MissingFields { | 82 | impl AstDiagnostic for MissingFields { |
83 | type AST = ast::RecordFieldList; | 83 | type AST = ast::RecordExprFieldList; |
84 | 84 | ||
85 | fn ast(&self, db: &dyn AstDatabase) -> Self::AST { | 85 | fn ast(&self, db: &dyn AstDatabase) -> Self::AST { |
86 | let root = db.parse_or_expand(self.source().file_id).unwrap(); | 86 | let root = db.parse_or_expand(self.source().file_id).unwrap(); |
87 | let node = self.source().value.to_node(&root); | 87 | let node = self.source().value.to_node(&root); |
88 | ast::RecordFieldList::cast(node).unwrap() | 88 | ast::RecordExprFieldList::cast(node).unwrap() |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
diff --git a/crates/ra_hir_ty/src/diagnostics/expr.rs b/crates/ra_hir_ty/src/diagnostics/expr.rs index fd930eab1..f0e0f2988 100644 --- a/crates/ra_hir_ty/src/diagnostics/expr.rs +++ b/crates/ra_hir_ty/src/diagnostics/expr.rs | |||
@@ -100,8 +100,8 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
100 | 100 | ||
101 | if let Ok(source_ptr) = source_map.expr_syntax(id) { | 101 | if let Ok(source_ptr) = source_map.expr_syntax(id) { |
102 | let root = source_ptr.file_syntax(db.upcast()); | 102 | let root = source_ptr.file_syntax(db.upcast()); |
103 | if let ast::Expr::RecordLit(record_lit) = &source_ptr.value.to_node(&root) { | 103 | if let ast::Expr::RecordExpr(record_lit) = &source_ptr.value.to_node(&root) { |
104 | if let Some(field_list) = record_lit.record_field_list() { | 104 | if let Some(field_list) = record_lit.record_expr_field_list() { |
105 | let variant_data = variant_data(db.upcast(), variant_def); | 105 | let variant_data = variant_data(db.upcast(), variant_def); |
106 | let missed_fields = missed_fields | 106 | let missed_fields = missed_fields |
107 | .into_iter() | 107 | .into_iter() |