diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-06 18:44:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-06 18:44:58 +0100 |
commit | 52c0ecb9825853d83357ccbac9f6fcb4bffa7348 (patch) | |
tree | cce18424094010e01c366703f4ed771a3e1dd479 /crates/hir_ty/src/infer | |
parent | e6a1c9ca60c19bf3b02b302e21d9f9fd9bd8a466 (diff) | |
parent | 230c763648ad87e07d843a52c134b12d1b7397f4 (diff) |
Merge #8380
8380: infer: remove `record_pat_field_resolutions` field r=jonas-schievink a=jonas-schievink
Same as https://github.com/rust-analyzer/rust-analyzer/pull/8376, this
can be computed from other data
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/pat.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index 942f70edf..e4813c87c 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs | |||
@@ -7,7 +7,6 @@ use chalk_ir::Mutability; | |||
7 | use hir_def::{ | 7 | use hir_def::{ |
8 | expr::{BindingAnnotation, Expr, Literal, Pat, PatId, RecordFieldPat}, | 8 | expr::{BindingAnnotation, Expr, Literal, Pat, PatId, RecordFieldPat}, |
9 | path::Path, | 9 | path::Path, |
10 | FieldId, | ||
11 | }; | 10 | }; |
12 | use hir_expand::name::Name; | 11 | use hir_expand::name::Name; |
13 | 12 | ||
@@ -80,11 +79,6 @@ impl<'a> InferenceContext<'a> { | |||
80 | let field_tys = def.map(|it| self.db.field_types(it)).unwrap_or_default(); | 79 | let field_tys = def.map(|it| self.db.field_types(it)).unwrap_or_default(); |
81 | for subpat in subpats { | 80 | for subpat in subpats { |
82 | let matching_field = var_data.as_ref().and_then(|it| it.field(&subpat.name)); | 81 | let matching_field = var_data.as_ref().and_then(|it| it.field(&subpat.name)); |
83 | if let Some(local_id) = matching_field { | ||
84 | let field_def = FieldId { parent: def.unwrap(), local_id }; | ||
85 | self.result.record_pat_field_resolutions.insert(subpat.pat, field_def); | ||
86 | } | ||
87 | |||
88 | let expected_ty = matching_field.map_or(self.err_ty(), |field| { | 82 | let expected_ty = matching_field.map_or(self.err_ty(), |field| { |
89 | field_tys[field].clone().substitute(&Interner, &substs) | 83 | field_tys[field].clone().substitute(&Interner, &substs) |
90 | }); | 84 | }); |