From d4f4ae0dd88f0baf0065d612f41fea3d54af79fd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 22 Nov 2019 18:46:39 +0300 Subject: Move const&static date to hir_def --- crates/ra_hir/src/ty/infer.rs | 8 ++++---- crates/ra_hir/src/ty/lower.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 6e07ab86e..39976a359 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -22,7 +22,7 @@ use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; use rustc_hash::FxHashMap; use hir_def::{ - data::FunctionData, + data::{ConstData, FunctionData}, path::known, resolver::{HasResolver, Resolver, TypeNs}, type_ref::{Mutability, TypeRef}, @@ -44,8 +44,8 @@ use crate::{ db::HirDatabase, expr::{BindingAnnotation, Body, ExprId, PatId}, ty::infer::diagnostics::InferenceDiagnostic, - Adt, AssocItem, ConstData, DefWithBody, FloatTy, Function, HasBody, IntTy, Path, StructField, - Trait, VariantDef, + Adt, AssocItem, DefWithBody, FloatTy, Function, HasBody, IntTy, Path, StructField, Trait, + VariantDef, }; macro_rules! ty_app { @@ -560,7 +560,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { } fn collect_const(&mut self, data: &ConstData) { - self.return_ty = self.make_ty(data.type_ref()); + self.return_ty = self.make_ty(&data.type_ref); } fn collect_fn(&mut self, data: &FunctionData) { diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 42daa9cb9..ac7f3f775 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs @@ -642,7 +642,7 @@ fn type_for_const(db: &impl HirDatabase, def: Const) -> Ty { let data = def.data(db); let resolver = def.id.resolver(db); - Ty::from_hir(db, &resolver, data.type_ref()) + Ty::from_hir(db, &resolver, &data.type_ref) } /// Build the declared type of a static. @@ -650,7 +650,7 @@ fn type_for_static(db: &impl HirDatabase, def: Static) -> Ty { let data = def.data(db); let resolver = def.id.resolver(db); - Ty::from_hir(db, &resolver, data.type_ref()) + Ty::from_hir(db, &resolver, &data.type_ref) } /// Build the declared type of a static. -- cgit v1.2.3