aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-01-14 13:20:33 +0000
committerAleksey Kladov <[email protected]>2020-01-14 13:24:03 +0000
commit21c5fd8b1b8f9536449325738baea1e48efdefe0 (patch)
tree36fc95b08d825eb55f6621f9ff6bf86164dae157 /crates/ra_hir
parent7ec62ea5e686dcb6de5d3fcc413f32af9d1c9cb5 (diff)
Push resolver further up
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/source_analyzer.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs
index 3df48842d..5707a5696 100644
--- a/crates/ra_hir/src/source_analyzer.rs
+++ b/crates/ra_hir/src/source_analyzer.rs
@@ -358,10 +358,17 @@ impl SourceAnalyzer {
358 // FIXME check that? 358 // FIXME check that?
359 // FIXME replace Unknown by bound vars here 359 // FIXME replace Unknown by bound vars here
360 let canonical = Canonical { value: ty.ty.value.clone(), num_vars: 0 }; 360 let canonical = Canonical { value: ty.ty.value.clone(), num_vars: 0 };
361
362 let env = TraitEnvironment::lower(db, &self.resolver);
363 let krate = self.resolver.krate()?;
364 let traits_in_scope = self.resolver.traits_in_scope(db);
365
361 method_resolution::iterate_method_candidates( 366 method_resolution::iterate_method_candidates(
362 &canonical, 367 &canonical,
363 db, 368 db,
364 &self.resolver, 369 env,
370 krate,
371 &traits_in_scope,
365 name, 372 name,
366 method_resolution::LookupMode::MethodCall, 373 method_resolution::LookupMode::MethodCall,
367 |ty, it| match it { 374 |ty, it| match it {
@@ -382,10 +389,17 @@ impl SourceAnalyzer {
382 // FIXME check that? 389 // FIXME check that?
383 // FIXME replace Unknown by bound vars here 390 // FIXME replace Unknown by bound vars here
384 let canonical = Canonical { value: ty.ty.value.clone(), num_vars: 0 }; 391 let canonical = Canonical { value: ty.ty.value.clone(), num_vars: 0 };
392
393 let env = TraitEnvironment::lower(db, &self.resolver);
394 let krate = self.resolver.krate()?;
395 let traits_in_scope = self.resolver.traits_in_scope(db);
396
385 method_resolution::iterate_method_candidates( 397 method_resolution::iterate_method_candidates(
386 &canonical, 398 &canonical,
387 db, 399 db,
388 &self.resolver, 400 env,
401 krate,
402 &traits_in_scope,
389 name, 403 name,
390 method_resolution::LookupMode::Path, 404 method_resolution::LookupMode::Path,
391 |ty, it| callback(ty, it.into()), 405 |ty, it| callback(ty, it.into()),