aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-25 13:23:34 +0100
committerAleksey Kladov <[email protected]>2020-04-25 13:23:34 +0100
commit970dbf871795650ecf49b7198d53bdcad9c612af (patch)
tree24b14acc3cfb37489c413c0dfba16dbc8b630869 /crates/ra_hir_ty/src/infer.rs
parent7bc71732300a57fad928393220ecbe5f751cc20f (diff)
Rename StructField -> Field
Diffstat (limited to 'crates/ra_hir_ty/src/infer.rs')
-rw-r--r--crates/ra_hir_ty/src/infer.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs
index dfb6a435f..6a53be621 100644
--- a/crates/ra_hir_ty/src/infer.rs
+++ b/crates/ra_hir_ty/src/infer.rs
@@ -28,7 +28,7 @@ use hir_def::{
28 path::{path, Path}, 28 path::{path, Path},
29 resolver::{HasResolver, Resolver, TypeNs}, 29 resolver::{HasResolver, Resolver, TypeNs},
30 type_ref::{Mutability, TypeRef}, 30 type_ref::{Mutability, TypeRef},
31 AdtId, AssocItemId, DefWithBodyId, FunctionId, StructFieldId, TraitId, TypeAliasId, VariantId, 31 AdtId, AssocItemId, DefWithBodyId, FieldId, FunctionId, TraitId, TypeAliasId, VariantId,
32}; 32};
33use hir_expand::{diagnostics::DiagnosticSink, name::name}; 33use hir_expand::{diagnostics::DiagnosticSink, name::name};
34use ra_arena::map::ArenaMap; 34use ra_arena::map::ArenaMap;
@@ -124,10 +124,10 @@ pub struct InferenceResult {
124 /// For each method call expr, records the function it resolves to. 124 /// For each method call expr, records the function it resolves to.
125 method_resolutions: FxHashMap<ExprId, FunctionId>, 125 method_resolutions: FxHashMap<ExprId, FunctionId>,
126 /// For each field access expr, records the field it resolves to. 126 /// For each field access expr, records the field it resolves to.
127 field_resolutions: FxHashMap<ExprId, StructFieldId>, 127 field_resolutions: FxHashMap<ExprId, FieldId>,
128 /// For each field in record literal, records the field it resolves to. 128 /// For each field in record literal, records the field it resolves to.
129 record_field_resolutions: FxHashMap<ExprId, StructFieldId>, 129 record_field_resolutions: FxHashMap<ExprId, FieldId>,
130 record_field_pat_resolutions: FxHashMap<PatId, StructFieldId>, 130 record_field_pat_resolutions: FxHashMap<PatId, FieldId>,
131 /// For each struct literal, records the variant it resolves to. 131 /// For each struct literal, records the variant it resolves to.
132 variant_resolutions: FxHashMap<ExprOrPatId, VariantId>, 132 variant_resolutions: FxHashMap<ExprOrPatId, VariantId>,
133 /// For each associated item record what it resolves to 133 /// For each associated item record what it resolves to
@@ -142,13 +142,13 @@ impl InferenceResult {
142 pub fn method_resolution(&self, expr: ExprId) -> Option<FunctionId> { 142 pub fn method_resolution(&self, expr: ExprId) -> Option<FunctionId> {
143 self.method_resolutions.get(&expr).copied() 143 self.method_resolutions.get(&expr).copied()
144 } 144 }
145 pub fn field_resolution(&self, expr: ExprId) -> Option<StructFieldId> { 145 pub fn field_resolution(&self, expr: ExprId) -> Option<FieldId> {
146 self.field_resolutions.get(&expr).copied() 146 self.field_resolutions.get(&expr).copied()
147 } 147 }
148 pub fn record_field_resolution(&self, expr: ExprId) -> Option<StructFieldId> { 148 pub fn record_field_resolution(&self, expr: ExprId) -> Option<FieldId> {
149 self.record_field_resolutions.get(&expr).copied() 149 self.record_field_resolutions.get(&expr).copied()
150 } 150 }
151 pub fn record_field_pat_resolution(&self, pat: PatId) -> Option<StructFieldId> { 151 pub fn record_field_pat_resolution(&self, pat: PatId) -> Option<FieldId> {
152 self.record_field_pat_resolutions.get(&pat).copied() 152 self.record_field_pat_resolutions.get(&pat).copied()
153 } 153 }
154 pub fn variant_resolution_for_expr(&self, id: ExprId) -> Option<VariantId> { 154 pub fn variant_resolution_for_expr(&self, id: ExprId) -> Option<VariantId> {
@@ -249,7 +249,7 @@ impl<'a> InferenceContext<'a> {
249 self.result.method_resolutions.insert(expr, func); 249 self.result.method_resolutions.insert(expr, func);
250 } 250 }
251 251
252 fn write_field_resolution(&mut self, expr: ExprId, field: StructFieldId) { 252 fn write_field_resolution(&mut self, expr: ExprId, field: FieldId) {
253 self.result.field_resolutions.insert(expr, field); 253 self.result.field_resolutions.insert(expr, field);
254 } 254 }
255 255