aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/infer/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/infer/expr.rs')
-rw-r--r--crates/ra_hir/src/ty/infer/expr.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs
index ac570075f..20a7e9352 100644
--- a/crates/ra_hir/src/ty/infer/expr.rs
+++ b/crates/ra_hir/src/ty/infer/expr.rs
@@ -5,6 +5,7 @@ use std::sync::Arc;
5 5
6use hir_def::{ 6use hir_def::{
7 builtin_type::Signedness, 7 builtin_type::Signedness,
8 generics::GenericParams,
8 path::{GenericArg, GenericArgs}, 9 path::{GenericArg, GenericArgs},
9 resolver::resolver_for_expr, 10 resolver::resolver_for_expr,
10}; 11};
@@ -13,7 +14,6 @@ use hir_expand::name;
13use crate::{ 14use crate::{
14 db::HirDatabase, 15 db::HirDatabase,
15 expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, 16 expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
16 generics::{GenericParams, HasGenericParams},
17 ty::{ 17 ty::{
18 autoderef, method_resolution, op, CallableDef, InferTy, IntTy, Mutability, Namespace, 18 autoderef, method_resolution, op, CallableDef, InferTy, IntTy, Mutability, Namespace,
19 Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk, 19 Obligation, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk,
@@ -534,7 +534,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
534 ( 534 (
535 ty, 535 ty,
536 self.db.type_for_def(func.into(), Namespace::Values), 536 self.db.type_for_def(func.into(), Namespace::Values),
537 Some(func.generic_params(self.db)), 537 Some(self.db.generic_params(func.id.into())),
538 ) 538 )
539 } 539 }
540 None => (receiver_ty, Ty::Unknown, None), 540 None => (receiver_ty, Ty::Unknown, None),
@@ -645,7 +645,9 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
645 if let Some(trait_) = f.parent_trait(self.db) { 645 if let Some(trait_) = f.parent_trait(self.db) {
646 // construct a TraitDef 646 // construct a TraitDef
647 let substs = a_ty.parameters.prefix( 647 let substs = a_ty.parameters.prefix(
648 trait_.generic_params(self.db).count_params_including_parent(), 648 self.db
649 .generic_params(trait_.id.into())
650 .count_params_including_parent(),
649 ); 651 );
650 self.obligations.push(Obligation::Trait(TraitRef { trait_, substs })); 652 self.obligations.push(Obligation::Trait(TraitRef { trait_, substs }));
651 } 653 }