aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-05 16:13:50 +0100
committerFlorian Diebold <[email protected]>2021-04-05 18:19:18 +0100
commit69714d36e6617800f3edea174f5d6f76c985ad4c (patch)
treee74b3e3ab442e4e2e36c3985de978ebbbccf7634 /crates/hir/src
parent6e9798a992b30b735f14018379e0861d2ec30647 (diff)
Hide Binders internals more
Diffstat (limited to 'crates/hir/src')
-rw-r--r--crates/hir/src/lib.rs4
-rw-r--r--crates/hir/src/semantics.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index b14c9a675..ccfe348a4 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -702,7 +702,7 @@ impl_from!(Struct, Union, Enum for Adt);
702impl Adt { 702impl Adt {
703 pub fn has_non_default_type_params(self, db: &dyn HirDatabase) -> bool { 703 pub fn has_non_default_type_params(self, db: &dyn HirDatabase) -> bool {
704 let subst = db.generic_defaults(self.into()); 704 let subst = db.generic_defaults(self.into());
705 subst.iter().any(|ty| ty.value.is_unknown()) 705 subst.iter().any(|ty| ty.skip_binders().is_unknown())
706 } 706 }
707 707
708 /// Turns this ADT into a type. Any type parameters of the ADT will be 708 /// Turns this ADT into a type. Any type parameters of the ADT will be
@@ -1089,7 +1089,7 @@ pub struct TypeAlias {
1089impl TypeAlias { 1089impl TypeAlias {
1090 pub fn has_non_default_type_params(self, db: &dyn HirDatabase) -> bool { 1090 pub fn has_non_default_type_params(self, db: &dyn HirDatabase) -> bool {
1091 let subst = db.generic_defaults(self.id.into()); 1091 let subst = db.generic_defaults(self.id.into());
1092 subst.iter().any(|ty| ty.value.is_unknown()) 1092 subst.iter().any(|ty| ty.skip_binders().is_unknown())
1093 } 1093 }
1094 1094
1095 pub fn module(self, db: &dyn HirDatabase) -> Module { 1095 pub fn module(self, db: &dyn HirDatabase) -> Module {
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 3bf722d2a..7955bf0b5 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -494,9 +494,9 @@ impl<'db> SemanticsImpl<'db> {
494 fn resolve_method_call_as_callable(&self, call: &ast::MethodCallExpr) -> Option<Callable> { 494 fn resolve_method_call_as_callable(&self, call: &ast::MethodCallExpr) -> Option<Callable> {
495 // FIXME: this erases Substs 495 // FIXME: this erases Substs
496 let func = self.resolve_method_call(call)?; 496 let func = self.resolve_method_call(call)?;
497 let ty = self.db.value_ty(func.into()); 497 let (ty, _) = self.db.value_ty(func.into()).into_value_and_skipped_binders();
498 let resolver = self.analyze(call.syntax()).resolver; 498 let resolver = self.analyze(call.syntax()).resolver;
499 let ty = Type::new_with_resolver(self.db, &resolver, ty.value)?; 499 let ty = Type::new_with_resolver(self.db, &resolver, ty)?;
500 let mut res = ty.as_callable(self.db)?; 500 let mut res = ty.as_callable(self.db)?;
501 res.is_bound_method = true; 501 res.is_bound_method = true;
502 Some(res) 502 Some(res)