More decoupling

This commit is contained in:
Aleksey Kladov 2019-11-27 16:02:33 +03:00
parent d569869f7a
commit 17680f6060
4 changed files with 27 additions and 33 deletions

View file

@ -618,7 +618,7 @@ impl Function {
}
pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> {
db.infer(self.into())
db.infer(self.id.into())
}
/// The containing impl block, if this is a method.
@ -672,7 +672,7 @@ impl Const {
}
pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> {
db.infer(self.into())
db.infer(self.id.into())
}
/// The containing impl block, if this is a type alias.
@ -715,7 +715,7 @@ impl Static {
}
pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> {
db.infer(self.into())
db.infer(self.id.into())
}
}
@ -908,9 +908,9 @@ impl Local {
}
pub fn ty(self, db: &impl HirDatabase) -> Type {
let infer = db.infer(self.parent);
let ty = infer[self.pat_id].clone();
let def = DefWithBodyId::from(self.parent);
let infer = db.infer(def);
let ty = infer[self.pat_id].clone();
let resolver = def.resolver(db);
let krate = def.module(db).krate;
let environment = TraitEnvironment::lower(db, &resolver);