aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/method_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/method_resolution.rs')
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index 7df2649c9..02e81fb34 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -18,7 +18,7 @@ use crate::{
18 db::HirDatabase, 18 db::HirDatabase,
19 ty::primitive::{FloatBitness, Uncertain}, 19 ty::primitive::{FloatBitness, Uncertain},
20 ty::{utils::all_super_traits, Ty, TypeCtor}, 20 ty::{utils::all_super_traits, Ty, TypeCtor},
21 AssocItem, Function, 21 Function,
22}; 22};
23 23
24use super::{autoderef, Canonical, InEnvironment, TraitEnvironment, TraitRef}; 24use super::{autoderef, Canonical, InEnvironment, TraitEnvironment, TraitRef};
@@ -157,7 +157,7 @@ pub(crate) fn lookup_method(
157) -> Option<(Ty, Function)> { 157) -> Option<(Ty, Function)> {
158 iterate_method_candidates(ty, db, resolver, Some(name), LookupMode::MethodCall, |ty, f| match f 158 iterate_method_candidates(ty, db, resolver, Some(name), LookupMode::MethodCall, |ty, f| match f
159 { 159 {
160 AssocItem::Function(f) => Some((ty.clone(), f)), 160 AssocItemId::FunctionId(f) => Some((ty.clone(), f.into())),
161 _ => None, 161 _ => None,
162 }) 162 })
163} 163}
@@ -183,7 +183,7 @@ pub(crate) fn iterate_method_candidates<T>(
183 resolver: &Resolver, 183 resolver: &Resolver,
184 name: Option<&Name>, 184 name: Option<&Name>,
185 mode: LookupMode, 185 mode: LookupMode,
186 mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, 186 mut callback: impl FnMut(&Ty, AssocItemId) -> Option<T>,
187) -> Option<T> { 187) -> Option<T> {
188 let krate = resolver.krate()?; 188 let krate = resolver.krate()?;
189 match mode { 189 match mode {
@@ -239,7 +239,7 @@ fn iterate_trait_method_candidates<T>(
239 resolver: &Resolver, 239 resolver: &Resolver,
240 name: Option<&Name>, 240 name: Option<&Name>,
241 mode: LookupMode, 241 mode: LookupMode,
242 mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, 242 mut callback: impl FnMut(&Ty, AssocItemId) -> Option<T>,
243) -> Option<T> { 243) -> Option<T> {
244 let krate = resolver.krate()?; 244 let krate = resolver.krate()?;
245 // FIXME: maybe put the trait_env behind a query (need to figure out good input parameters for that) 245 // FIXME: maybe put the trait_env behind a query (need to figure out good input parameters for that)
@@ -285,7 +285,7 @@ fn iterate_inherent_methods<T>(
285 name: Option<&Name>, 285 name: Option<&Name>,
286 mode: LookupMode, 286 mode: LookupMode,
287 krate: CrateId, 287 krate: CrateId,
288 mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, 288 mut callback: impl FnMut(&Ty, AssocItemId) -> Option<T>,
289) -> Option<T> { 289) -> Option<T> {
290 for krate in ty.value.def_crates(db, krate)? { 290 for krate in ty.value.def_crates(db, krate)? {
291 let impls = db.impls_in_crate(krate); 291 let impls = db.impls_in_crate(krate);