diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 6d71bde92..0e987240a 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -618,7 +618,7 @@ impl Function { | |||
618 | } | 618 | } |
619 | 619 | ||
620 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { | 620 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { |
621 | db.infer(self.into()) | 621 | db.infer(self.id.into()) |
622 | } | 622 | } |
623 | 623 | ||
624 | /// The containing impl block, if this is a method. | 624 | /// The containing impl block, if this is a method. |
@@ -672,7 +672,7 @@ impl Const { | |||
672 | } | 672 | } |
673 | 673 | ||
674 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { | 674 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { |
675 | db.infer(self.into()) | 675 | db.infer(self.id.into()) |
676 | } | 676 | } |
677 | 677 | ||
678 | /// The containing impl block, if this is a type alias. | 678 | /// The containing impl block, if this is a type alias. |
@@ -715,7 +715,7 @@ impl Static { | |||
715 | } | 715 | } |
716 | 716 | ||
717 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { | 717 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { |
718 | db.infer(self.into()) | 718 | db.infer(self.id.into()) |
719 | } | 719 | } |
720 | } | 720 | } |
721 | 721 | ||
@@ -908,9 +908,9 @@ impl Local { | |||
908 | } | 908 | } |
909 | 909 | ||
910 | pub fn ty(self, db: &impl HirDatabase) -> Type { | 910 | pub fn ty(self, db: &impl HirDatabase) -> Type { |
911 | let infer = db.infer(self.parent); | ||
912 | let ty = infer[self.pat_id].clone(); | ||
913 | let def = DefWithBodyId::from(self.parent); | 911 | let def = DefWithBodyId::from(self.parent); |
912 | let infer = db.infer(def); | ||
913 | let ty = infer[self.pat_id].clone(); | ||
914 | let resolver = def.resolver(db); | 914 | let resolver = def.resolver(db); |
915 | let krate = def.module(db).krate; | 915 | let krate = def.module(db).krate; |
916 | let environment = TraitEnvironment::lower(db, &resolver); | 916 | let environment = TraitEnvironment::lower(db, &resolver); |