aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer/expr.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-25 13:25:28 +0100
committerGitHub <[email protected]>2020-04-25 13:25:28 +0100
commit05981823bac91ba338110902fd435c6e3166f1d6 (patch)
tree24b14acc3cfb37489c413c0dfba16dbc8b630869 /crates/ra_hir_ty/src/infer/expr.rs
parent7bc71732300a57fad928393220ecbe5f751cc20f (diff)
parent970dbf871795650ecf49b7198d53bdcad9c612af (diff)
Merge #4135
4135: Rename StructField -> Field r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/infer/expr.rs')
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs
index 1fdb235a0..83f946eee 100644
--- a/crates/ra_hir_ty/src/infer/expr.rs
+++ b/crates/ra_hir_ty/src/infer/expr.rs
@@ -8,7 +8,7 @@ use hir_def::{
8 expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, 8 expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
9 path::{GenericArg, GenericArgs}, 9 path::{GenericArg, GenericArgs},
10 resolver::resolver_for_expr, 10 resolver::resolver_for_expr,
11 AdtId, AssocContainerId, Lookup, StructFieldId, 11 AdtId, AssocContainerId, FieldId, Lookup,
12}; 12};
13use hir_expand::name::Name; 13use hir_expand::name::Name;
14use ra_syntax::ast::RangeOp; 14use ra_syntax::ast::RangeOp;
@@ -216,9 +216,7 @@ impl<'a> InferenceContext<'a> {
216 for (field_idx, field) in fields.iter().enumerate() { 216 for (field_idx, field) in fields.iter().enumerate() {
217 let field_def = 217 let field_def =
218 variant_data.as_ref().and_then(|it| match it.field(&field.name) { 218 variant_data.as_ref().and_then(|it| match it.field(&field.name) {
219 Some(local_id) => { 219 Some(local_id) => Some(FieldId { parent: def_id.unwrap(), local_id }),
220 Some(StructFieldId { parent: def_id.unwrap(), local_id })
221 }
222 None => { 220 None => {
223 self.push_diagnostic(InferenceDiagnostic::NoSuchField { 221 self.push_diagnostic(InferenceDiagnostic::NoSuchField {
224 expr: tgt_expr, 222 expr: tgt_expr,
@@ -257,7 +255,7 @@ impl<'a> InferenceContext<'a> {
257 .and_then(|idx| a_ty.parameters.0.get(idx).cloned()), 255 .and_then(|idx| a_ty.parameters.0.get(idx).cloned()),
258 TypeCtor::Adt(AdtId::StructId(s)) => { 256 TypeCtor::Adt(AdtId::StructId(s)) => {
259 self.db.struct_data(s).variant_data.field(name).map(|local_id| { 257 self.db.struct_data(s).variant_data.field(name).map(|local_id| {
260 let field = StructFieldId { parent: s.into(), local_id }; 258 let field = FieldId { parent: s.into(), local_id };
261 self.write_field_resolution(tgt_expr, field); 259 self.write_field_resolution(tgt_expr, field);
262 self.db.field_types(s.into())[field.local_id] 260 self.db.field_types(s.into())[field.local_id]
263 .clone() 261 .clone()