mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Hide Binders internals more
This commit is contained in:
parent
6e9798a992
commit
69714d36e6
11 changed files with 108 additions and 88 deletions
|
@ -702,7 +702,7 @@ impl_from!(Struct, Union, Enum for Adt);
|
|||
impl Adt {
|
||||
pub fn has_non_default_type_params(self, db: &dyn HirDatabase) -> bool {
|
||||
let subst = db.generic_defaults(self.into());
|
||||
subst.iter().any(|ty| ty.value.is_unknown())
|
||||
subst.iter().any(|ty| ty.skip_binders().is_unknown())
|
||||
}
|
||||
|
||||
/// Turns this ADT into a type. Any type parameters of the ADT will be
|
||||
|
@ -1089,7 +1089,7 @@ pub struct TypeAlias {
|
|||
impl TypeAlias {
|
||||
pub fn has_non_default_type_params(self, db: &dyn HirDatabase) -> bool {
|
||||
let subst = db.generic_defaults(self.id.into());
|
||||
subst.iter().any(|ty| ty.value.is_unknown())
|
||||
subst.iter().any(|ty| ty.skip_binders().is_unknown())
|
||||
}
|
||||
|
||||
pub fn module(self, db: &dyn HirDatabase) -> Module {
|
||||
|
|
|
@ -494,9 +494,9 @@ impl<'db> SemanticsImpl<'db> {
|
|||
fn resolve_method_call_as_callable(&self, call: &ast::MethodCallExpr) -> Option<Callable> {
|
||||
// FIXME: this erases Substs
|
||||
let func = self.resolve_method_call(call)?;
|
||||
let ty = self.db.value_ty(func.into());
|
||||
let (ty, _) = self.db.value_ty(func.into()).into_value_and_skipped_binders();
|
||||
let resolver = self.analyze(call.syntax()).resolver;
|
||||
let ty = Type::new_with_resolver(self.db, &resolver, ty.value)?;
|
||||
let ty = Type::new_with_resolver(self.db, &resolver, ty)?;
|
||||
let mut res = ty.as_callable(self.db)?;
|
||||
res.is_bound_method = true;
|
||||
Some(res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue