diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-08 07:57:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-08 07:57:49 +0100 |
commit | 839035c6be133def24853ddc6d0e7ad03aad0c2d (patch) | |
tree | 7d44c7e64dab1426aacbea26ea447ca0df8347aa /crates/ra_hir/src | |
parent | 787f1206a975ea82d7af878f2acaea15b08b5d36 (diff) | |
parent | 6021a2a83a2e229847905c6d06ba412faddd1acb (diff) |
Merge #1788
1788: cleanup hir db imports r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
24 files changed, 65 insertions, 43 deletions
diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs index c65446df4..728046b0d 100644 --- a/crates/ra_hir/src/adt.rs +++ b/crates/ra_hir/src/adt.rs | |||
@@ -7,8 +7,10 @@ use ra_arena::{impl_arena_id, Arena, RawId}; | |||
7 | use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner}; | 7 | use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner}; |
8 | 8 | ||
9 | use crate::{ | 9 | use crate::{ |
10 | type_ref::TypeRef, AsName, AstDatabase, Crate, DefDatabase, Enum, EnumVariant, FieldSource, | 10 | db::{AstDatabase, DefDatabase, HirDatabase}, |
11 | HasSource, HirDatabase, Name, Source, Struct, StructField, Union, | 11 | type_ref::TypeRef, |
12 | AsName, Crate, Enum, EnumVariant, FieldSource, HasSource, Name, Source, Struct, StructField, | ||
13 | Union, | ||
12 | }; | 14 | }; |
13 | 15 | ||
14 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | 16 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 1bb2f9f28..2bac6122b 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -8,6 +8,7 @@ use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner}; | |||
8 | 8 | ||
9 | use crate::{ | 9 | use crate::{ |
10 | adt::{EnumVariantId, StructFieldId, VariantDef}, | 10 | adt::{EnumVariantId, StructFieldId, VariantDef}, |
11 | db::{AstDatabase, DefDatabase, HirDatabase}, | ||
11 | diagnostics::DiagnosticSink, | 12 | diagnostics::DiagnosticSink, |
12 | expr::{validation::ExprValidator, Body, BodySourceMap}, | 13 | expr::{validation::ExprValidator, Body, BodySourceMap}, |
13 | generics::HasGenericParams, | 14 | generics::HasGenericParams, |
@@ -29,7 +30,7 @@ use crate::{ | |||
29 | }, | 30 | }, |
30 | type_ref::Mutability, | 31 | type_ref::Mutability, |
31 | type_ref::TypeRef, | 32 | type_ref::TypeRef, |
32 | AsName, AstDatabase, AstId, DefDatabase, Either, HasSource, HirDatabase, Name, Ty, | 33 | AsName, AstId, Either, HasSource, Name, Ty, |
33 | }; | 34 | }; |
34 | 35 | ||
35 | /// hir::Crate describes a single crate. It's the main interface with which | 36 | /// hir::Crate describes a single crate. It's the main interface with which |
diff --git a/crates/ra_hir/src/code_model/docs.rs b/crates/ra_hir/src/code_model/docs.rs index a2b4d8e97..99edc5814 100644 --- a/crates/ra_hir/src/code_model/docs.rs +++ b/crates/ra_hir/src/code_model/docs.rs | |||
@@ -3,8 +3,9 @@ use std::sync::Arc; | |||
3 | use ra_syntax::ast; | 3 | use ra_syntax::ast; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | AstDatabase, Const, DefDatabase, Enum, EnumVariant, FieldSource, Function, HasSource, | 6 | db::{AstDatabase, DefDatabase, HirDatabase}, |
7 | HirDatabase, MacroDef, Module, Static, Struct, StructField, Trait, TypeAlias, Union, | 7 | Const, Enum, EnumVariant, FieldSource, Function, HasSource, MacroDef, Module, Static, Struct, |
8 | StructField, Trait, TypeAlias, Union, | ||
8 | }; | 9 | }; |
9 | 10 | ||
10 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | 11 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index b9ffb0c7a..c0cb27b47 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -4,9 +4,10 @@ use ra_syntax::{ | |||
4 | }; | 4 | }; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | ids::AstItemDef, AstDatabase, Const, DefDatabase, Either, Enum, EnumVariant, FieldSource, | 7 | db::{AstDatabase, DefDatabase, HirDatabase}, |
8 | Function, HasBody, HirDatabase, HirFileId, MacroDef, Module, ModuleSource, Static, Struct, | 8 | ids::AstItemDef, |
9 | StructField, Trait, TypeAlias, Union, | 9 | Const, Either, Enum, EnumVariant, FieldSource, Function, HasBody, HirFileId, MacroDef, Module, |
10 | ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union, | ||
10 | }; | 11 | }; |
11 | 12 | ||
12 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] | 13 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index 475dd5766..60da33695 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs | |||
@@ -3,7 +3,7 @@ use std::{any::Any, fmt}; | |||
3 | use ra_syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr, TextRange}; | 3 | use ra_syntax::{ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr, TextRange}; |
4 | use relative_path::RelativePathBuf; | 4 | use relative_path::RelativePathBuf; |
5 | 5 | ||
6 | use crate::{HirDatabase, HirFileId, Name, Source}; | 6 | use crate::{db::HirDatabase, HirFileId, Name, Source}; |
7 | 7 | ||
8 | /// Diagnostic defines hir API for errors and warnings. | 8 | /// Diagnostic defines hir API for errors and warnings. |
9 | /// | 9 | /// |
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index fc21e269f..698fa671b 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -9,10 +9,11 @@ use ra_syntax::{ast, AstPtr}; | |||
9 | use rustc_hash::FxHashMap; | 9 | use rustc_hash::FxHashMap; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | db::HirDatabase, | ||
12 | path::GenericArgs, | 13 | path::GenericArgs, |
13 | ty::primitive::{UncertainFloatTy, UncertainIntTy}, | 14 | ty::primitive::{UncertainFloatTy, UncertainIntTy}, |
14 | type_ref::{Mutability, TypeRef}, | 15 | type_ref::{Mutability, TypeRef}, |
15 | DefWithBody, Either, HasSource, HirDatabase, Name, Path, Resolver, Source, | 16 | DefWithBody, Either, HasSource, Name, Path, Resolver, Source, |
16 | }; | 17 | }; |
17 | 18 | ||
18 | pub use self::scope::ExprScopes; | 19 | pub use self::scope::ExprScopes; |
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs index 6afd80989..8bd041ff0 100644 --- a/crates/ra_hir/src/expr/lower.rs +++ b/crates/ra_hir/src/expr/lower.rs | |||
@@ -9,12 +9,13 @@ use ra_syntax::{ | |||
9 | use test_utils::tested_by; | 9 | use test_utils::tested_by; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | db::HirDatabase, | ||
12 | name::{AsName, Name, SELF_PARAM}, | 13 | name::{AsName, Name, SELF_PARAM}, |
13 | path::GenericArgs, | 14 | path::GenericArgs, |
14 | ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, | 15 | ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, |
15 | type_ref::TypeRef, | 16 | type_ref::TypeRef, |
16 | DefWithBody, Either, HirDatabase, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, | 17 | DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver, |
17 | Resolver, Source, | 18 | Source, |
18 | }; | 19 | }; |
19 | 20 | ||
20 | use super::{ | 21 | use super::{ |
diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs index b6d7f3fc1..de0983a7e 100644 --- a/crates/ra_hir/src/expr/scope.rs +++ b/crates/ra_hir/src/expr/scope.rs | |||
@@ -4,8 +4,9 @@ use ra_arena::{impl_arena_id, Arena, RawId}; | |||
4 | use rustc_hash::FxHashMap; | 4 | use rustc_hash::FxHashMap; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | db::HirDatabase, | ||
7 | expr::{Body, Expr, ExprId, Pat, PatId, Statement}, | 8 | expr::{Body, Expr, ExprId, Pat, PatId, Statement}, |
8 | DefWithBody, HirDatabase, Name, | 9 | DefWithBody, Name, |
9 | }; | 10 | }; |
10 | 11 | ||
11 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 12 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs index 1202913e2..6a22e1318 100644 --- a/crates/ra_hir/src/expr/validation.rs +++ b/crates/ra_hir/src/expr/validation.rs | |||
@@ -5,12 +5,13 @@ use rustc_hash::FxHashSet; | |||
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | adt::AdtDef, | 7 | adt::AdtDef, |
8 | db::HirDatabase, | ||
8 | diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr}, | 9 | diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr}, |
9 | expr::AstPtr, | 10 | expr::AstPtr, |
10 | name, | 11 | name, |
11 | path::{PathKind, PathSegment}, | 12 | path::{PathKind, PathSegment}, |
12 | ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, | 13 | ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, |
13 | Function, HirDatabase, ModuleDef, Name, Path, PerNs, Resolution, | 14 | Function, ModuleDef, Name, Path, PerNs, Resolution, |
14 | }; | 15 | }; |
15 | 16 | ||
16 | use super::{Expr, ExprId, RecordLitField}; | 17 | use super::{Expr, ExprId, RecordLitField}; |
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index ec756f2c3..e0d0d4209 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -8,7 +8,10 @@ use ra_db::{salsa, FileId}; | |||
8 | use ra_prof::profile; | 8 | use ra_prof::profile; |
9 | use ra_syntax::{ast, AstNode, Parse, SyntaxNode}; | 9 | use ra_syntax::{ast, AstNode, Parse, SyntaxNode}; |
10 | 10 | ||
11 | use crate::{AstDatabase, AstId, DefDatabase, FileAstId, InternDatabase, Module, Source}; | 11 | use crate::{ |
12 | db::{AstDatabase, DefDatabase, InternDatabase}, | ||
13 | AstId, FileAstId, Module, Source, | ||
14 | }; | ||
12 | 15 | ||
13 | /// hir makes heavy use of ids: integer (u32) handlers to various things. You | 16 | /// hir makes heavy use of ids: integer (u32) handlers to various things. You |
14 | /// can think of id as a pointer (but without a lifetime) or a file descriptor | 17 | /// can think of id as a pointer (but without a lifetime) or a file descriptor |
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 62a41719a..162ab02b1 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -9,13 +9,13 @@ use ra_syntax::{ | |||
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | code_model::{Module, ModuleSource}, | 11 | code_model::{Module, ModuleSource}, |
12 | db::{AstDatabase, DefDatabase, HirDatabase}, | ||
12 | generics::HasGenericParams, | 13 | generics::HasGenericParams, |
13 | ids::LocationCtx, | 14 | ids::LocationCtx, |
14 | resolve::Resolver, | 15 | resolve::Resolver, |
15 | ty::Ty, | 16 | ty::Ty, |
16 | type_ref::TypeRef, | 17 | type_ref::TypeRef, |
17 | AstDatabase, Const, DefDatabase, Function, HasSource, HirDatabase, HirFileId, Source, TraitRef, | 18 | Const, Function, HasSource, HirFileId, Source, TraitRef, TypeAlias, |
18 | TypeAlias, | ||
19 | }; | 19 | }; |
20 | 20 | ||
21 | #[derive(Debug, Default, PartialEq, Eq)] | 21 | #[derive(Debug, Default, PartialEq, Eq)] |
diff --git a/crates/ra_hir/src/lang_item.rs b/crates/ra_hir/src/lang_item.rs index fd6609fb8..832fdf1f5 100644 --- a/crates/ra_hir/src/lang_item.rs +++ b/crates/ra_hir/src/lang_item.rs | |||
@@ -4,8 +4,8 @@ use std::sync::Arc; | |||
4 | use ra_syntax::{ast::AttrsOwner, SmolStr}; | 4 | use ra_syntax::{ast::AttrsOwner, SmolStr}; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | AstDatabase, Crate, DefDatabase, Enum, Function, HasSource, HirDatabase, ImplBlock, Module, | 7 | db::{AstDatabase, DefDatabase, HirDatabase}, |
8 | ModuleDef, Static, Struct, Trait, | 8 | Crate, Enum, Function, HasSource, ImplBlock, Module, ModuleDef, Static, Struct, Trait, |
9 | }; | 9 | }; |
10 | 10 | ||
11 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 11 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index c3e589921..7c2a68992 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -49,7 +49,6 @@ mod code_model; | |||
49 | mod marks; | 49 | mod marks; |
50 | 50 | ||
51 | use crate::{ | 51 | use crate::{ |
52 | db::{AstDatabase, DefDatabase, HirDatabase, InternDatabase}, | ||
53 | ids::MacroFileKind, | 52 | ids::MacroFileKind, |
54 | name::AsName, | 53 | name::AsName, |
55 | resolve::Resolver, | 54 | resolve::Resolver, |
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index fe90879b6..7de422128 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -65,9 +65,12 @@ use rustc_hash::{FxHashMap, FxHashSet}; | |||
65 | use test_utils::tested_by; | 65 | use test_utils::tested_by; |
66 | 66 | ||
67 | use crate::{ | 67 | use crate::{ |
68 | diagnostics::DiagnosticSink, either::Either, ids::MacroDefId, | 68 | db::{AstDatabase, DefDatabase}, |
69 | nameres::diagnostics::DefDiagnostic, AstDatabase, AstId, BuiltinType, Crate, DefDatabase, | 69 | diagnostics::DiagnosticSink, |
70 | HirFileId, MacroDef, Module, ModuleDef, Name, Path, PathKind, Trait, | 70 | either::Either, |
71 | ids::MacroDefId, | ||
72 | nameres::diagnostics::DefDiagnostic, | ||
73 | AstId, BuiltinType, Crate, HirFileId, MacroDef, Module, ModuleDef, Name, Path, PathKind, Trait, | ||
71 | }; | 74 | }; |
72 | 75 | ||
73 | pub(crate) use self::raw::{ImportSourceMap, RawItems}; | 76 | pub(crate) use self::raw::{ImportSourceMap, RawItems}; |
@@ -516,9 +519,10 @@ mod diagnostics { | |||
516 | use relative_path::RelativePathBuf; | 519 | use relative_path::RelativePathBuf; |
517 | 520 | ||
518 | use crate::{ | 521 | use crate::{ |
522 | db::{AstDatabase, DefDatabase}, | ||
519 | diagnostics::{DiagnosticSink, UnresolvedModule}, | 523 | diagnostics::{DiagnosticSink, UnresolvedModule}, |
520 | nameres::CrateModuleId, | 524 | nameres::CrateModuleId, |
521 | AstDatabase, AstId, DefDatabase, | 525 | AstId, |
522 | }; | 526 | }; |
523 | 527 | ||
524 | #[derive(Debug, PartialEq, Eq)] | 528 | #[derive(Debug, PartialEq, Eq)] |
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 34b90a666..1c0d4369e 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs | |||
@@ -4,6 +4,7 @@ use rustc_hash::FxHashMap; | |||
4 | use test_utils::tested_by; | 4 | use test_utils::tested_by; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | db::DefDatabase, | ||
7 | either::Either, | 8 | either::Either, |
8 | ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind}, | 9 | ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind}, |
9 | name::MACRO_RULES, | 10 | name::MACRO_RULES, |
@@ -13,8 +14,8 @@ use crate::{ | |||
13 | raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData, ModuleDef, PerNs, | 14 | raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData, ModuleDef, PerNs, |
14 | ReachedFixedPoint, Resolution, ResolveMode, | 15 | ReachedFixedPoint, Resolution, ResolveMode, |
15 | }, | 16 | }, |
16 | AstId, Const, DefDatabase, Enum, Function, HirFileId, MacroDef, Module, Name, Path, Static, | 17 | AstId, Const, Enum, Function, HirFileId, MacroDef, Module, Name, Path, Static, Struct, Trait, |
17 | Struct, Trait, TypeAlias, Union, | 18 | TypeAlias, Union, |
18 | }; | 19 | }; |
19 | 20 | ||
20 | pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { | 21 | pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { |
@@ -699,7 +700,7 @@ mod tests { | |||
699 | use ra_db::SourceDatabase; | 700 | use ra_db::SourceDatabase; |
700 | 701 | ||
701 | use super::*; | 702 | use super::*; |
702 | use crate::{mock::MockDatabase, Crate, DefDatabase}; | 703 | use crate::{db::DefDatabase, mock::MockDatabase, Crate}; |
703 | use ra_arena::Arena; | 704 | use ra_arena::Arena; |
704 | use rustc_hash::FxHashSet; | 705 | use rustc_hash::FxHashSet; |
705 | 706 | ||
diff --git a/crates/ra_hir/src/nameres/mod_resolution.rs b/crates/ra_hir/src/nameres/mod_resolution.rs index 918c9591f..a9e9eb9e6 100644 --- a/crates/ra_hir/src/nameres/mod_resolution.rs +++ b/crates/ra_hir/src/nameres/mod_resolution.rs | |||
@@ -6,7 +6,7 @@ use ra_db::{FileId, SourceRoot}; | |||
6 | use ra_syntax::SmolStr; | 6 | use ra_syntax::SmolStr; |
7 | use relative_path::RelativePathBuf; | 7 | use relative_path::RelativePathBuf; |
8 | 8 | ||
9 | use crate::{DefDatabase, HirFileId, Name}; | 9 | use crate::{db::DefDatabase, HirFileId, Name}; |
10 | 10 | ||
11 | #[derive(Clone, Copy)] | 11 | #[derive(Clone, Copy)] |
12 | pub(super) struct ParentModule<'a> { | 12 | pub(super) struct ParentModule<'a> { |
diff --git a/crates/ra_hir/src/nameres/raw.rs b/crates/ra_hir/src/nameres/raw.rs index 129b047eb..7963736e0 100644 --- a/crates/ra_hir/src/nameres/raw.rs +++ b/crates/ra_hir/src/nameres/raw.rs | |||
@@ -8,8 +8,8 @@ use ra_syntax::{ | |||
8 | use test_utils::tested_by; | 8 | use test_utils::tested_by; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | AsName, AstDatabase, AstIdMap, DefDatabase, Either, FileAstId, HirFileId, ModuleSource, Name, | 11 | db::{AstDatabase, DefDatabase}, |
12 | Path, | 12 | AsName, AstIdMap, Either, FileAstId, HirFileId, ModuleSource, Name, Path, |
13 | }; | 13 | }; |
14 | 14 | ||
15 | /// `RawItems` is a set of top-level items in a file (except for impls). | 15 | /// `RawItems` is a set of top-level items in a file (except for impls). |
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index fdbe5e8b0..afdcd5415 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -18,6 +18,7 @@ use ra_syntax::{ | |||
18 | use rustc_hash::{FxHashMap, FxHashSet}; | 18 | use rustc_hash::{FxHashMap, FxHashSet}; |
19 | 19 | ||
20 | use crate::{ | 20 | use crate::{ |
21 | db::HirDatabase, | ||
21 | expr::{ | 22 | expr::{ |
22 | self, | 23 | self, |
23 | scope::{ExprScopes, ScopeId}, | 24 | scope::{ExprScopes, ScopeId}, |
@@ -27,9 +28,8 @@ use crate::{ | |||
27 | name, | 28 | name, |
28 | path::{PathKind, PathSegment}, | 29 | path::{PathKind, PathSegment}, |
29 | ty::method_resolution::implements_trait, | 30 | ty::method_resolution::implements_trait, |
30 | AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirDatabase, | 31 | AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirFileId, MacroDef, |
31 | HirFileId, MacroDef, Module, ModuleDef, Name, Path, PerNs, Resolution, Resolver, Static, | 32 | Module, ModuleDef, Name, Path, PerNs, Resolution, Resolver, Static, Struct, Trait, Ty, |
32 | Struct, Trait, Ty, | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | /// Locates the module by `FileId`. Picks topmost module in the file. | 35 | /// Locates the module by `FileId`. Picks topmost module in the file. |
diff --git a/crates/ra_hir/src/source_id.rs b/crates/ra_hir/src/source_id.rs index 51cd65dda..04574876d 100644 --- a/crates/ra_hir/src/source_id.rs +++ b/crates/ra_hir/src/source_id.rs | |||
@@ -7,7 +7,7 @@ use std::{ | |||
7 | use ra_arena::{impl_arena_id, Arena, RawId}; | 7 | use ra_arena::{impl_arena_id, Arena, RawId}; |
8 | use ra_syntax::{ast, AstNode, SyntaxNode, SyntaxNodePtr}; | 8 | use ra_syntax::{ast, AstNode, SyntaxNode, SyntaxNodePtr}; |
9 | 9 | ||
10 | use crate::{AstDatabase, HirFileId}; | 10 | use crate::{db::AstDatabase, HirFileId}; |
11 | 11 | ||
12 | /// `AstId` points to an AST node in any file. | 12 | /// `AstId` points to an AST node in any file. |
13 | /// | 13 | /// |
diff --git a/crates/ra_hir/src/traits.rs b/crates/ra_hir/src/traits.rs index 6cdd3020a..4c2f7980d 100644 --- a/crates/ra_hir/src/traits.rs +++ b/crates/ra_hir/src/traits.rs | |||
@@ -6,8 +6,10 @@ use std::sync::Arc; | |||
6 | use ra_syntax::ast::{self, NameOwner}; | 6 | use ra_syntax::ast::{self, NameOwner}; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | ids::LocationCtx, name::AsName, AstDatabase, Const, DefDatabase, Function, HasSource, Module, | 9 | db::{AstDatabase, DefDatabase}, |
10 | Name, Trait, TypeAlias, | 10 | ids::LocationCtx, |
11 | name::AsName, | ||
12 | Const, Function, HasSource, Module, Name, Trait, TypeAlias, | ||
11 | }; | 13 | }; |
12 | 14 | ||
13 | #[derive(Debug, Clone, PartialEq, Eq)] | 15 | #[derive(Debug, Clone, PartialEq, Eq)] |
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index caa17f64e..5ba7cf2e0 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs | |||
@@ -8,7 +8,7 @@ use std::iter::successors; | |||
8 | use log::{info, warn}; | 8 | use log::{info, warn}; |
9 | 9 | ||
10 | use super::{traits::Solution, Canonical, Ty, TypeWalk}; | 10 | use super::{traits::Solution, Canonical, Ty, TypeWalk}; |
11 | use crate::{name, HasGenericParams, HirDatabase, Resolver}; | 11 | use crate::{db::HirDatabase, name, HasGenericParams, Resolver}; |
12 | 12 | ||
13 | const AUTODEREF_RECURSION_LIMIT: usize = 10; | 13 | const AUTODEREF_RECURSION_LIMIT: usize = 10; |
14 | 14 | ||
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 0e6ebd365..9244ff3cb 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -35,6 +35,7 @@ use super::{ | |||
35 | use crate::{ | 35 | use crate::{ |
36 | adt::VariantDef, | 36 | adt::VariantDef, |
37 | code_model::{ModuleDef::Trait, TypeAlias}, | 37 | code_model::{ModuleDef::Trait, TypeAlias}, |
38 | db::HirDatabase, | ||
38 | diagnostics::DiagnosticSink, | 39 | diagnostics::DiagnosticSink, |
39 | expr::{ | 40 | expr::{ |
40 | self, Array, BinaryOp, BindingAnnotation, Body, Expr, ExprId, Literal, Pat, PatId, | 41 | self, Array, BinaryOp, BindingAnnotation, Body, Expr, ExprId, Literal, Pat, PatId, |
@@ -50,8 +51,8 @@ use crate::{ | |||
50 | }, | 51 | }, |
51 | ty::infer::diagnostics::InferenceDiagnostic, | 52 | ty::infer::diagnostics::InferenceDiagnostic, |
52 | type_ref::{Mutability, TypeRef}, | 53 | type_ref::{Mutability, TypeRef}, |
53 | AdtDef, ConstData, DefWithBody, FnData, Function, HasBody, HirDatabase, ImplItem, ModuleDef, | 54 | AdtDef, ConstData, DefWithBody, FnData, Function, HasBody, ImplItem, ModuleDef, Name, Path, |
54 | Name, Path, StructField, | 55 | StructField, |
55 | }; | 56 | }; |
56 | 57 | ||
57 | mod unify; | 58 | mod unify; |
@@ -1614,9 +1615,10 @@ impl Expectation { | |||
1614 | 1615 | ||
1615 | mod diagnostics { | 1616 | mod diagnostics { |
1616 | use crate::{ | 1617 | use crate::{ |
1618 | db::HirDatabase, | ||
1617 | diagnostics::{DiagnosticSink, NoSuchField}, | 1619 | diagnostics::{DiagnosticSink, NoSuchField}, |
1618 | expr::ExprId, | 1620 | expr::ExprId, |
1619 | Function, HasSource, HirDatabase, | 1621 | Function, HasSource, |
1620 | }; | 1622 | }; |
1621 | 1623 | ||
1622 | #[derive(Debug, PartialEq, Eq, Clone)] | 1624 | #[derive(Debug, PartialEq, Eq, Clone)] |
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 480bae740..061229842 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -14,6 +14,7 @@ use super::{ | |||
14 | }; | 14 | }; |
15 | use crate::{ | 15 | use crate::{ |
16 | adt::VariantDef, | 16 | adt::VariantDef, |
17 | db::HirDatabase, | ||
17 | generics::HasGenericParams, | 18 | generics::HasGenericParams, |
18 | generics::{GenericDef, WherePredicate}, | 19 | generics::{GenericDef, WherePredicate}, |
19 | nameres::Namespace, | 20 | nameres::Namespace, |
@@ -21,8 +22,8 @@ use crate::{ | |||
21 | resolve::{Resolution, Resolver}, | 22 | resolve::{Resolution, Resolver}, |
22 | ty::AdtDef, | 23 | ty::AdtDef, |
23 | type_ref::{TypeBound, TypeRef}, | 24 | type_ref::{TypeBound, TypeRef}, |
24 | BuiltinType, Const, Enum, EnumVariant, Function, HirDatabase, ModuleDef, Path, Static, Struct, | 25 | BuiltinType, Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, |
25 | StructField, Trait, TypeAlias, Union, | 26 | Trait, TypeAlias, Union, |
26 | }; | 27 | }; |
27 | 28 | ||
28 | impl Ty { | 29 | impl Ty { |
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index cf787bdaa..be63806d4 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -9,6 +9,7 @@ use rustc_hash::FxHashMap; | |||
9 | 9 | ||
10 | use super::{autoderef, lower, Canonical, InEnvironment, TraitEnvironment, TraitRef}; | 10 | use super::{autoderef, lower, Canonical, InEnvironment, TraitEnvironment, TraitRef}; |
11 | use crate::{ | 11 | use crate::{ |
12 | db::HirDatabase, | ||
12 | generics::HasGenericParams, | 13 | generics::HasGenericParams, |
13 | impl_block::{ImplBlock, ImplId, ImplItem}, | 14 | impl_block::{ImplBlock, ImplId, ImplItem}, |
14 | nameres::CrateModuleId, | 15 | nameres::CrateModuleId, |
@@ -16,7 +17,7 @@ use crate::{ | |||
16 | traits::TraitItem, | 17 | traits::TraitItem, |
17 | ty::primitive::{FloatBitness, UncertainFloatTy, UncertainIntTy}, | 18 | ty::primitive::{FloatBitness, UncertainFloatTy, UncertainIntTy}, |
18 | ty::{Ty, TypeCtor}, | 19 | ty::{Ty, TypeCtor}, |
19 | Crate, Function, HirDatabase, Module, Name, Trait, | 20 | Crate, Function, Module, Name, Trait, |
20 | }; | 21 | }; |
21 | 22 | ||
22 | /// This is used as a key for indexing impls. | 23 | /// This is used as a key for indexing impls. |