From e9752308bbaa2fd720e1eeaca970977fe22514d1 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 6 Apr 2021 17:59:18 +0200 Subject: infer: remove `record_field_resolutions` field It stores no useful data, since we can derive all fields from `variant_resolutions` --- crates/hir_ty/src/utils.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'crates/hir_ty/src/utils.rs') diff --git a/crates/hir_ty/src/utils.rs b/crates/hir_ty/src/utils.rs index d11708299..0a424f607 100644 --- a/crates/hir_ty/src/utils.rs +++ b/crates/hir_ty/src/utils.rs @@ -4,7 +4,6 @@ use std::sync::Arc; use chalk_ir::{BoundVar, DebruijnIndex}; use hir_def::{ - adt::VariantData, db::DefDatabase, generics::{ GenericParams, TypeParamData, TypeParamProvenance, WherePredicate, WherePredicateTypeTarget, @@ -13,7 +12,7 @@ use hir_def::{ path::Path, resolver::{HasResolver, TypeNs}, type_ref::TypeRef, - AssocContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId, + AssocContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, }; use hir_expand::name::{name, Name}; @@ -136,16 +135,6 @@ pub(super) fn associated_type_by_name_including_super_traits( }) } -pub(super) fn variant_data(db: &dyn DefDatabase, var: VariantId) -> Arc { - match var { - VariantId::StructId(it) => db.struct_data(it).variant_data.clone(), - VariantId::UnionId(it) => db.union_data(it).variant_data.clone(), - VariantId::EnumVariantId(it) => { - db.enum_data(it.parent).variants[it.local_id].variant_data.clone() - } - } -} - /// Helper for mutating `Arc<[T]>` (i.e. `Arc::make_mut` for Arc slices). /// The underlying values are cloned if there are other strong references. pub(crate) fn make_mut_slice(a: &mut Arc<[T]>) -> &mut [T] { -- cgit v1.2.3