aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/method_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/method_resolution.rs')
-rw-r--r--crates/ra_hir_ty/src/method_resolution.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/method_resolution.rs b/crates/ra_hir_ty/src/method_resolution.rs
index 4f8c52433..964acdb09 100644
--- a/crates/ra_hir_ty/src/method_resolution.rs
+++ b/crates/ra_hir_ty/src/method_resolution.rs
@@ -214,7 +214,7 @@ pub fn iterate_method_candidates<T>(
214 // the methods by autoderef order of *receiver types*, not *self 214 // the methods by autoderef order of *receiver types*, not *self
215 // types*. 215 // types*.
216 216
217 let deref_chain: Vec<_> = autoderef::autoderef(db, Some(krate), ty.clone()).collect(); 217 let deref_chain: Vec<_> = autoderef::autoderef(db, Some(krate), ty).collect();
218 for i in 0..deref_chain.len() { 218 for i in 0..deref_chain.len() {
219 if let Some(result) = iterate_method_candidates_with_autoref( 219 if let Some(result) = iterate_method_candidates_with_autoref(
220 &deref_chain[i..], 220 &deref_chain[i..],
@@ -290,7 +290,7 @@ fn iterate_method_candidates_with_autoref<T>(
290 &ref_muted, 290 &ref_muted,
291 deref_chain, 291 deref_chain,
292 db, 292 db,
293 env.clone(), 293 env,
294 krate, 294 krate,
295 &traits_in_scope, 295 &traits_in_scope,
296 name, 296 name,
@@ -391,17 +391,17 @@ fn iterate_trait_method_candidates<T>(
391 // iteration 391 // iteration
392 let mut known_implemented = false; 392 let mut known_implemented = false;
393 for (_name, item) in data.items.iter() { 393 for (_name, item) in data.items.iter() {
394 if !is_valid_candidate(db, name, receiver_ty, (*item).into(), self_ty) { 394 if !is_valid_candidate(db, name, receiver_ty, *item, self_ty) {
395 continue; 395 continue;
396 } 396 }
397 if !known_implemented { 397 if !known_implemented {
398 let goal = generic_implements_goal(db, env.clone(), t, self_ty.clone()); 398 let goal = generic_implements_goal(db, env.clone(), t, self_ty.clone());
399 if db.trait_solve(krate.into(), goal).is_none() { 399 if db.trait_solve(krate, goal).is_none() {
400 continue 'traits; 400 continue 'traits;
401 } 401 }
402 } 402 }
403 known_implemented = true; 403 known_implemented = true;
404 if let Some(result) = callback(&self_ty.value, (*item).into()) { 404 if let Some(result) = callback(&self_ty.value, *item) {
405 return Some(result); 405 return Some(result);
406 } 406 }
407 } 407 }
@@ -521,7 +521,7 @@ pub fn implements_trait(
521 return true; 521 return true;
522 } 522 }
523 let goal = generic_implements_goal(db, env, trait_, ty.clone()); 523 let goal = generic_implements_goal(db, env, trait_, ty.clone());
524 let solution = db.trait_solve(krate.into(), goal); 524 let solution = db.trait_solve(krate, goal);
525 525
526 solution.is_some() 526 solution.is_some()
527} 527}