From b017bae8370e166034ac569c357b662358d45f19 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 8 Dec 2019 12:26:53 +0100 Subject: remove `infer` method from CodeModel --- crates/ra_hir/src/code_model.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9cbea024a..0100ac91c 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -31,7 +31,7 @@ use ra_syntax::ast; use crate::{ db::{DefDatabase, HirDatabase}, ty::display::HirFormatter, - ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk}, + ty::{self, InEnvironment, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk}, CallableDef, HirDisplay, InFile, Name, }; @@ -519,10 +519,6 @@ impl Function { db.body(self.id.into()) } - pub fn infer(self, db: &impl HirDatabase) -> Arc { - db.infer(self.id.into()) - } - /// The containing impl block, if this is a method. pub fn impl_block(self, db: &impl DefDatabase) -> Option { match self.container(db) { @@ -548,7 +544,7 @@ impl Function { } pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { - let infer = self.infer(db); + let infer = db.infer(self.id.into()); infer.add_diagnostics(db, self.id, sink); let mut validator = ExprValidator::new(self.id, infer, sink); validator.validate_body(db); @@ -573,10 +569,6 @@ impl Const { db.const_data(self.id).name.clone() } - pub fn infer(self, db: &impl HirDatabase) -> Arc { - db.infer(self.id.into()) - } - /// The containing impl block, if this is a type alias. pub fn impl_block(self, db: &impl DefDatabase) -> Option { match self.container(db) { @@ -615,10 +607,6 @@ impl Static { pub fn krate(self, db: &impl DefDatabase) -> Option { Some(self.module(db).krate()) } - - pub fn infer(self, db: &impl HirDatabase) -> Arc { - db.infer(self.id.into()) - } } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -- cgit v1.2.3