aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-30 20:45:35 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-30 20:45:35 +0000
commitdb17e06c2eec892ab807fd191bc11b15d8da42e2 (patch)
tree18046068a9d7bb72747bbabfc22d1121fea1604a /crates/ra_hir/src/ty.rs
parentc65e6cdcb3d603ce7c0943785f7140662022c54a (diff)
parent1acff307fe2e20f0c2291fd24b08fba6fa39e5ee (diff)
Merge #711
711: Rename FnScopes and move them below the expr module r=matklad a=flodiebold Extracted from #693 to reduce the diff and make rebasing easier for me :wink: The scopes belong to a body, which could be that of a function, but also a constant, static or array size. So this moves them to a submodule of `expr`. Also move the `expr_scopes` query from `query_definitions` to that module. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index 7a5485698..0472414a6 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -34,7 +34,7 @@ use test_utils::tested_by;
34 34
35use crate::{ 35use crate::{
36 Module, Function, Struct, StructField, Enum, EnumVariant, Path, Name, ImplBlock, 36 Module, Function, Struct, StructField, Enum, EnumVariant, Path, Name, ImplBlock,
37 FnSignature, FnScopes, ModuleDef, AdtDef, 37 FnSignature, ExprScopes, ModuleDef, AdtDef,
38 db::HirDatabase, 38 db::HirDatabase,
39 type_ref::{TypeRef, Mutability}, 39 type_ref::{TypeRef, Mutability},
40 name::KnownName, 40 name::KnownName,
@@ -814,7 +814,7 @@ impl Index<PatId> for InferenceResult {
814struct InferenceContext<'a, D: HirDatabase> { 814struct InferenceContext<'a, D: HirDatabase> {
815 db: &'a D, 815 db: &'a D,
816 body: Arc<Body>, 816 body: Arc<Body>,
817 scopes: Arc<FnScopes>, 817 scopes: Arc<ExprScopes>,
818 module: Module, 818 module: Module,
819 impl_block: Option<ImplBlock>, 819 impl_block: Option<ImplBlock>,
820 var_unification_table: InPlaceUnificationTable<TypeVarId>, 820 var_unification_table: InPlaceUnificationTable<TypeVarId>,
@@ -908,7 +908,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
908 fn new( 908 fn new(
909 db: &'a D, 909 db: &'a D,
910 body: Arc<Body>, 910 body: Arc<Body>,
911 scopes: Arc<FnScopes>, 911 scopes: Arc<ExprScopes>,
912 module: Module, 912 module: Module,
913 impl_block: Option<ImplBlock>, 913 impl_block: Option<ImplBlock>,
914 ) -> Self { 914 ) -> Self {
@@ -1720,7 +1720,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1720pub fn infer(db: &impl HirDatabase, func: Function) -> Arc<InferenceResult> { 1720pub fn infer(db: &impl HirDatabase, func: Function) -> Arc<InferenceResult> {
1721 db.check_canceled(); 1721 db.check_canceled();
1722 let body = func.body(db); 1722 let body = func.body(db);
1723 let scopes = db.fn_scopes(func); 1723 let scopes = db.expr_scopes(func);
1724 let module = func.module(db); 1724 let module = func.module(db);
1725 let impl_block = func.impl_block(db); 1725 let impl_block = func.impl_block(db);
1726 let mut ctx = InferenceContext::new(db, body, scopes, module, impl_block); 1726 let mut ctx = InferenceContext::new(db, body, scopes, module, impl_block);