Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/path.rs')
-rw-r--r--crates/hir-ty/src/infer/path.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/hir-ty/src/infer/path.rs b/crates/hir-ty/src/infer/path.rs
index ef1a610a32..71d68ccd47 100644
--- a/crates/hir-ty/src/infer/path.rs
+++ b/crates/hir-ty/src/infer/path.rs
@@ -4,6 +4,7 @@ use hir_def::{
AdtId, AssocItemId, GenericDefId, ItemContainerId, Lookup,
expr_store::path::{Path, PathSegment},
resolver::{ResolveValueResult, TypeNs, ValueNs},
+ signatures::{ConstSignature, FunctionSignature},
};
use hir_expand::name::Name;
use rustc_type_ir::inherent::{SliceLike, Ty as _};
@@ -136,7 +137,7 @@ impl<'db> InferenceContext<'_, 'db> {
let mut ctx = TyLoweringContext::new(
self.db,
&self.resolver,
- self.body,
+ self.store,
&self.diagnostics,
InferenceTyDiagnosticSource::Body,
self.generic_def,
@@ -159,16 +160,16 @@ impl<'db> InferenceContext<'_, 'db> {
let ty = self.table.process_user_written_ty(ty);
self.resolve_ty_assoc_item(ty, last.name, id).map(|(it, substs)| (it, Some(substs)))?
} else {
- let hygiene = self.body.expr_or_pat_path_hygiene(id);
+ let hygiene = self.store.expr_or_pat_path_hygiene(id);
// FIXME: report error, unresolved first path segment
let value_or_partial = path_ctx.resolve_path_in_value_ns(hygiene)?;
match value_or_partial {
- ResolveValueResult::ValueNs(it, _) => {
+ ResolveValueResult::ValueNs(it) => {
drop_ctx(ctx, no_diagnostics);
(it, None)
}
- ResolveValueResult::Partial(def, remaining_index, _) => {
+ ResolveValueResult::Partial(def, remaining_index) => {
// there may be more intermediate segments between the resolved one and
// the end. Only the last segment needs to be resolved to a value; from
// the segments before that, we need to get either a type or a trait ref.
@@ -263,7 +264,7 @@ impl<'db> InferenceContext<'_, 'db> {
trait_.trait_items(self.db).items.iter().map(|(_name, id)| *id).find_map(|item| {
match item {
AssocItemId::FunctionId(func) => {
- if segment.name == &self.db.function_signature(func).name {
+ if segment.name == &FunctionSignature::of(self.db, func).name {
Some(CandidateId::FunctionId(func))
} else {
None
@@ -271,7 +272,7 @@ impl<'db> InferenceContext<'_, 'db> {
}
AssocItemId::ConstId(konst) => {
- if self.db.const_signature(konst).name.as_ref() == Some(segment.name) {
+ if ConstSignature::of(self.db, konst).name.as_ref() == Some(segment.name) {
Some(CandidateId::ConstId(konst))
} else {
None