aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/infer.rs8
-rw-r--r--crates/ra_hir/src/ty/lower.rs4
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 39976a359..471bdc387 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -69,10 +69,10 @@ pub fn infer_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<InferenceResu
69 let resolver = DefWithBodyId::from(def).resolver(db); 69 let resolver = DefWithBodyId::from(def).resolver(db);
70 let mut ctx = InferenceContext::new(db, def, resolver); 70 let mut ctx = InferenceContext::new(db, def, resolver);
71 71
72 match def { 72 match &def {
73 DefWithBody::Const(ref c) => ctx.collect_const(&c.data(db)), 73 DefWithBody::Const(c) => ctx.collect_const(&db.const_data(c.id)),
74 DefWithBody::Function(ref f) => ctx.collect_fn(&db.function_data(f.id)), 74 DefWithBody::Function(f) => ctx.collect_fn(&db.function_data(f.id)),
75 DefWithBody::Static(ref s) => ctx.collect_const(&s.data(db)), 75 DefWithBody::Static(s) => ctx.collect_const(&db.static_data(s.id)),
76 } 76 }
77 77
78 ctx.infer_body(); 78 ctx.infer_body();
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index ac7f3f775..2272510e8 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -639,7 +639,7 @@ fn type_for_fn(db: &impl HirDatabase, def: Function) -> Ty {
639 639
640/// Build the declared type of a const. 640/// Build the declared type of a const.
641fn type_for_const(db: &impl HirDatabase, def: Const) -> Ty { 641fn type_for_const(db: &impl HirDatabase, def: Const) -> Ty {
642 let data = def.data(db); 642 let data = db.const_data(def.id);
643 let resolver = def.id.resolver(db); 643 let resolver = def.id.resolver(db);
644 644
645 Ty::from_hir(db, &resolver, &data.type_ref) 645 Ty::from_hir(db, &resolver, &data.type_ref)
@@ -647,7 +647,7 @@ fn type_for_const(db: &impl HirDatabase, def: Const) -> Ty {
647 647
648/// Build the declared type of a static. 648/// Build the declared type of a static.
649fn type_for_static(db: &impl HirDatabase, def: Static) -> Ty { 649fn type_for_static(db: &impl HirDatabase, def: Static) -> Ty {
650 let data = def.data(db); 650 let data = db.static_data(def.id);
651 let resolver = def.id.resolver(db); 651 let resolver = def.id.resolver(db);
652 652
653 Ty::from_hir(db, &resolver, &data.type_ref) 653 Ty::from_hir(db, &resolver, &data.type_ref)