Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/method_resolution.rs')
-rw-r--r--crates/hir-ty/src/method_resolution.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs
index ad4d79e68a..05b9ea5d74 100644
--- a/crates/hir-ty/src/method_resolution.rs
+++ b/crates/hir-ty/src/method_resolution.rs
@@ -17,11 +17,12 @@ use hir_def::{
ImplId, ItemContainerId, ModuleId, TraitId,
attrs::AttrFlags,
builtin_derive::BuiltinDeriveImplMethod,
- expr_store::path::GenericArgs as HirGenericArgs,
- hir::ExprId,
+ expr_store::{Body, path::GenericArgs as HirGenericArgs},
+ hir::{ExprId, generics::GenericParams},
lang_item::LangItems,
nameres::{DefMap, block_def_map, crate_def_map},
resolver::Resolver,
+ signatures::{ConstSignature, FunctionSignature},
};
use intern::{Symbol, sym};
use rustc_hash::{FxHashMap, FxHashSet};
@@ -366,7 +367,7 @@ pub fn lookup_impl_const<'db>(
};
let trait_ref = TraitRef::new_from_args(interner, trait_id.into(), subs);
- let const_signature = db.const_signature(const_id);
+ let const_signature = ConstSignature::of(db, const_id);
let name = match const_signature.name.as_ref() {
Some(name) => name,
None => return (const_id, subs),
@@ -396,7 +397,7 @@ pub fn is_dyn_method<'db>(
let ItemContainerId::TraitId(trait_id) = func.loc(db).container else {
return None;
};
- let trait_params = db.generic_params(trait_id.into()).len();
+ let trait_params = GenericParams::of(db, trait_id.into()).len();
let fn_params = fn_subst.len() - trait_params;
let trait_ref = TraitRef::new_from_args(
interner,
@@ -432,14 +433,14 @@ pub(crate) fn lookup_impl_method_query<'db>(
let ItemContainerId::TraitId(trait_id) = func.loc(db).container else {
return (Either::Left(func), fn_subst);
};
- let trait_params = db.generic_params(trait_id.into()).len();
+ let trait_params = GenericParams::of(db, trait_id.into()).len();
let trait_ref = TraitRef::new_from_args(
interner,
trait_id.into(),
GenericArgs::new_from_slice(&fn_subst[..trait_params]),
);
- let name = &db.function_signature(func).name;
+ let name = &FunctionSignature::of(db, func).name;
let Some((impl_fn, impl_subst)) =
lookup_impl_assoc_item_for_trait_ref(&infcx, trait_ref, env.param_env, name).and_then(
|(assoc, impl_args)| {
@@ -623,7 +624,7 @@ impl InherentImpls {
// To better support custom derives, collect impls in all unnamed const items.
// const _: () = { ... };
for konst in module_data.scope.unnamed_consts() {
- let body = db.body(konst.into());
+ let body = Body::of(db, konst.into());
for (_, block_def_map) in body.blocks(db) {
collect(db, block_def_map, map);
}
@@ -766,7 +767,7 @@ impl TraitImpls {
// To better support custom derives, collect impls in all unnamed const items.
// const _: () = { ... };
for konst in module_data.scope.unnamed_consts() {
- let body = db.body(konst.into());
+ let body = Body::of(db, konst.into());
for (_, block_def_map) in body.blocks(db) {
collect(db, block_def_map, lang_items, map);
}