aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/diagnostics.rs')
-rw-r--r--crates/ra_hir_ty/src/diagnostics.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs
index 885abbaf2..977c0525b 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)]
30pub struct NoSuchField { 30pub 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
35impl Diagnostic for NoSuchField { 35impl Diagnostic for NoSuchField {
@@ -47,19 +47,19 @@ impl Diagnostic for NoSuchField {
47} 47}
48 48
49impl AstDiagnostic for NoSuchField { 49impl 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)]
60pub struct MissingFields { 60pub 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,19 +80,19 @@ impl Diagnostic for MissingFields {
80} 80}
81 81
82impl AstDiagnostic for MissingFields { 82impl 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
92#[derive(Debug)] 92#[derive(Debug)]
93pub struct MissingPatFields { 93pub struct MissingPatFields {
94 pub file: HirFileId, 94 pub file: HirFileId,
95 pub field_list: AstPtr<ast::RecordFieldPatList>, 95 pub field_list: AstPtr<ast::RecordPatFieldList>,
96 pub missed_fields: Vec<Name>, 96 pub missed_fields: Vec<Name>,
97} 97}
98 98