aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/source_binder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r--crates/ra_hir/src/source_binder.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index c5a920688..9efd0477c 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -22,6 +22,10 @@ use hir_def::{
22use hir_expand::{ 22use hir_expand::{
23 hygiene::Hygiene, name::AsName, AstId, HirFileId, InFile, MacroCallId, MacroCallKind, 23 hygiene::Hygiene, name::AsName, AstId, HirFileId, InFile, MacroCallId, MacroCallKind,
24}; 24};
25use hir_ty::{
26 method_resolution::{self, implements_trait},
27 Canonical, InEnvironment, InferenceResult, TraitEnvironment, Ty,
28};
25use ra_syntax::{ 29use ra_syntax::{
26 ast::{self, AstNode}, 30 ast::{self, AstNode},
27 match_ast, AstPtr, 31 match_ast, AstPtr,
@@ -30,13 +34,9 @@ use ra_syntax::{
30}; 34};
31 35
32use crate::{ 36use crate::{
33 db::HirDatabase, 37 db::HirDatabase, Adt, AssocItem, Const, DefWithBody, Enum, EnumVariant, FromSource, Function,
34 ty::{ 38 ImplBlock, Local, MacroDef, Name, Path, ScopeDef, Static, Struct, Trait, Type, TypeAlias,
35 method_resolution::{self, implements_trait}, 39 TypeParam,
36 InEnvironment, TraitEnvironment, Ty,
37 },
38 Adt, AssocItem, Const, DefWithBody, Enum, EnumVariant, FromSource, Function, ImplBlock, Local,
39 MacroDef, Name, Path, ScopeDef, Static, Struct, Trait, Type, TypeAlias, TypeParam,
40}; 40};
41 41
42fn try_get_resolver_for_node(db: &impl HirDatabase, node: InFile<&SyntaxNode>) -> Option<Resolver> { 42fn try_get_resolver_for_node(db: &impl HirDatabase, node: InFile<&SyntaxNode>) -> Option<Resolver> {
@@ -100,7 +100,7 @@ pub struct SourceAnalyzer {
100 resolver: Resolver, 100 resolver: Resolver,
101 body_owner: Option<DefWithBody>, 101 body_owner: Option<DefWithBody>,
102 body_source_map: Option<Arc<BodySourceMap>>, 102 body_source_map: Option<Arc<BodySourceMap>>,
103 infer: Option<Arc<crate::ty::InferenceResult>>, 103 infer: Option<Arc<InferenceResult>>,
104 scopes: Option<Arc<ExprScopes>>, 104 scopes: Option<Arc<ExprScopes>>,
105} 105}
106 106
@@ -376,7 +376,7 @@ impl SourceAnalyzer {
376 // There should be no inference vars in types passed here 376 // There should be no inference vars in types passed here
377 // FIXME check that? 377 // FIXME check that?
378 // FIXME replace Unknown by bound vars here 378 // FIXME replace Unknown by bound vars here
379 let canonical = crate::ty::Canonical { value: ty.ty.value.clone(), num_vars: 0 }; 379 let canonical = Canonical { value: ty.ty.value.clone(), num_vars: 0 };
380 method_resolution::iterate_method_candidates( 380 method_resolution::iterate_method_candidates(
381 &canonical, 381 &canonical,
382 db, 382 db,
@@ -400,7 +400,7 @@ impl SourceAnalyzer {
400 // There should be no inference vars in types passed here 400 // There should be no inference vars in types passed here
401 // FIXME check that? 401 // FIXME check that?
402 // FIXME replace Unknown by bound vars here 402 // FIXME replace Unknown by bound vars here
403 let canonical = crate::ty::Canonical { value: ty.ty.value.clone(), num_vars: 0 }; 403 let canonical = Canonical { value: ty.ty.value.clone(), num_vars: 0 };
404 method_resolution::iterate_method_candidates( 404 method_resolution::iterate_method_candidates(
405 &canonical, 405 &canonical,
406 db, 406 db,
@@ -418,7 +418,7 @@ impl SourceAnalyzer {
418 // ) -> impl Iterator<Item = Ty> + 'a { 418 // ) -> impl Iterator<Item = Ty> + 'a {
419 // // There should be no inference vars in types passed here 419 // // There should be no inference vars in types passed here
420 // // FIXME check that? 420 // // FIXME check that?
421 // let canonical = crate::ty::Canonical { value: ty, num_vars: 0 }; 421 // let canonical = Canonical { value: ty, num_vars: 0 };
422 // let krate = self.resolver.krate(); 422 // let krate = self.resolver.krate();
423 // let environment = TraitEnvironment::lower(db, &self.resolver); 423 // let environment = TraitEnvironment::lower(db, &self.resolver);
424 // let ty = crate::ty::InEnvironment { value: canonical, environment }; 424 // let ty = crate::ty::InEnvironment { value: canonical, environment };
@@ -440,7 +440,7 @@ impl SourceAnalyzer {
440 _ => return false, 440 _ => return false,
441 }; 441 };
442 442
443 let canonical_ty = crate::ty::Canonical { value: ty, num_vars: 0 }; 443 let canonical_ty = Canonical { value: ty, num_vars: 0 };
444 implements_trait(&canonical_ty, db, &self.resolver, krate.into(), std_future_trait) 444 implements_trait(&canonical_ty, db, &self.resolver, krate.into(), std_future_trait)
445 } 445 }
446 446