aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-08 11:26:53 +0000
committerAleksey Kladov <[email protected]>2019-12-08 11:26:53 +0000
commitb017bae8370e166034ac569c357b662358d45f19 (patch)
tree0f726a02fc0906469807313a3abe45c08ee3391e /crates
parent7aacf9a19739f53a45840df2d08b5f3cca761192 (diff)
remove `infer` method from CodeModel
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/code_model.rs16
1 files changed, 2 insertions, 14 deletions
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;
31use crate::{ 31use crate::{
32 db::{DefDatabase, HirDatabase}, 32 db::{DefDatabase, HirDatabase},
33 ty::display::HirFormatter, 33 ty::display::HirFormatter,
34 ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk}, 34 ty::{self, InEnvironment, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk},
35 CallableDef, HirDisplay, InFile, Name, 35 CallableDef, HirDisplay, InFile, Name,
36}; 36};
37 37
@@ -519,10 +519,6 @@ impl Function {
519 db.body(self.id.into()) 519 db.body(self.id.into())
520 } 520 }
521 521
522 pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> {
523 db.infer(self.id.into())
524 }
525
526 /// The containing impl block, if this is a method. 522 /// The containing impl block, if this is a method.
527 pub fn impl_block(self, db: &impl DefDatabase) -> Option<ImplBlock> { 523 pub fn impl_block(self, db: &impl DefDatabase) -> Option<ImplBlock> {
528 match self.container(db) { 524 match self.container(db) {
@@ -548,7 +544,7 @@ impl Function {
548 } 544 }
549 545
550 pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { 546 pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) {
551 let infer = self.infer(db); 547 let infer = db.infer(self.id.into());
552 infer.add_diagnostics(db, self.id, sink); 548 infer.add_diagnostics(db, self.id, sink);
553 let mut validator = ExprValidator::new(self.id, infer, sink); 549 let mut validator = ExprValidator::new(self.id, infer, sink);
554 validator.validate_body(db); 550 validator.validate_body(db);
@@ -573,10 +569,6 @@ impl Const {
573 db.const_data(self.id).name.clone() 569 db.const_data(self.id).name.clone()
574 } 570 }
575 571
576 pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> {
577 db.infer(self.id.into())
578 }
579
580 /// The containing impl block, if this is a type alias. 572 /// The containing impl block, if this is a type alias.
581 pub fn impl_block(self, db: &impl DefDatabase) -> Option<ImplBlock> { 573 pub fn impl_block(self, db: &impl DefDatabase) -> Option<ImplBlock> {
582 match self.container(db) { 574 match self.container(db) {
@@ -615,10 +607,6 @@ impl Static {
615 pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> { 607 pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> {
616 Some(self.module(db).krate()) 608 Some(self.module(db).krate())
617 } 609 }
618
619 pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> {
620 db.infer(self.id.into())
621 }
622} 610}
623 611
624#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 612#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]