aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-30 14:24:36 +0000
committerAleksey Kladov <[email protected]>2019-10-30 14:43:14 +0000
commite56433432057712086ca623c4a1ef40089004839 (patch)
treeff07a196ffcd7c6f298f6d0ef7563f05c2264d4e
parentf8ddef875af08f6c67fe69f7803f3926bc6f66bb (diff)
remove forward pointer to Path
-rw-r--r--crates/ra_hir/src/expr.rs2
-rw-r--r--crates/ra_hir/src/expr/lower.rs6
-rw-r--r--crates/ra_hir/src/expr/validation.rs2
-rw-r--r--crates/ra_hir/src/generics.rs6
-rw-r--r--crates/ra_hir/src/lib.rs7
-rw-r--r--crates/ra_hir/src/path.rs1
-rw-r--r--crates/ra_hir/src/resolve.rs2
-rw-r--r--crates/ra_hir/src/source_binder.rs3
-rw-r--r--crates/ra_hir/src/ty/infer.rs3
-rw-r--r--crates/ra_hir/src/ty/infer/expr.rs6
-rw-r--r--crates/ra_hir/src/ty/infer/path.rs6
-rw-r--r--crates/ra_hir/src/ty/lower.rs3
12 files changed, 27 insertions, 20 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index d238741ba..31857ad56 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -6,13 +6,13 @@ pub(crate) mod validation;
6 6
7use std::{ops::Index, sync::Arc}; 7use std::{ops::Index, sync::Arc};
8 8
9use hir_def::path::GenericArgs;
9use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; 10use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId};
10use ra_syntax::{ast, AstPtr}; 11use ra_syntax::{ast, AstPtr};
11use rustc_hash::FxHashMap; 12use rustc_hash::FxHashMap;
12 13
13use crate::{ 14use crate::{
14 db::HirDatabase, 15 db::HirDatabase,
15 path::GenericArgs,
16 ty::primitive::{UncertainFloatTy, UncertainIntTy}, 16 ty::primitive::{UncertainFloatTy, UncertainIntTy},
17 type_ref::{Mutability, TypeRef}, 17 type_ref::{Mutability, TypeRef},
18 DefWithBody, Either, HasSource, Name, Path, Resolver, Source, 18 DefWithBody, Either, HasSource, Name, Path, Resolver, Source,
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs
index cf8a41b1e..6436c3a24 100644
--- a/crates/ra_hir/src/expr/lower.rs
+++ b/crates/ra_hir/src/expr/lower.rs
@@ -1,6 +1,9 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use hir_def::name::{self, AsName, Name}; 3use hir_def::{
4 name::{self, AsName, Name},
5 path::GenericArgs,
6};
4use ra_arena::Arena; 7use ra_arena::Arena;
5use ra_syntax::{ 8use ra_syntax::{
6 ast::{ 9 ast::{
@@ -13,7 +16,6 @@ use test_utils::tested_by;
13 16
14use crate::{ 17use crate::{
15 db::HirDatabase, 18 db::HirDatabase,
16 path::GenericArgs,
17 ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, 19 ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy},
18 type_ref::TypeRef, 20 type_ref::TypeRef,
19 AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver, 21 AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver,
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs
index 1aa853c3e..c685edda1 100644
--- a/crates/ra_hir/src/expr/validation.rs
+++ b/crates/ra_hir/src/expr/validation.rs
@@ -2,6 +2,7 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use hir_def::path::known;
5use ra_syntax::ast; 6use ra_syntax::ast;
6use rustc_hash::FxHashSet; 7use rustc_hash::FxHashSet;
7 8
@@ -9,7 +10,6 @@ use crate::{
9 db::HirDatabase, 10 db::HirDatabase,
10 diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr}, 11 diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr},
11 expr::AstPtr, 12 expr::AstPtr,
12 path::known,
13 ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, 13 ty::{ApplicationTy, InferenceResult, Ty, TypeCtor},
14 Adt, Function, Name, Path, 14 Adt, Function, Name, Path,
15}; 15};
diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs
index 61786a614..45f9713a0 100644
--- a/crates/ra_hir/src/generics.rs
+++ b/crates/ra_hir/src/generics.rs
@@ -5,12 +5,14 @@
5 5
6use std::sync::Arc; 6use std::sync::Arc;
7 7
8use hir_def::name::{self, AsName}; 8use hir_def::{
9 name::{self, AsName},
10 path::Path,
11};
9use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner}; 12use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner};
10 13
11use crate::{ 14use crate::{
12 db::{AstDatabase, DefDatabase, HirDatabase}, 15 db::{AstDatabase, DefDatabase, HirDatabase},
13 path::Path,
14 type_ref::{TypeBound, TypeRef}, 16 type_ref::{TypeBound, TypeRef},
15 Adt, Const, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, Trait, 17 Adt, Const, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, Trait,
16 TypeAlias, Union, 18 TypeAlias, Union,
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 620911459..e723a1f40 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -32,7 +32,6 @@ pub mod debug;
32pub mod db; 32pub mod db;
33#[macro_use] 33#[macro_use]
34pub mod mock; 34pub mod mock;
35mod path;
36pub mod source_binder; 35pub mod source_binder;
37 36
38mod ids; 37mod ids;
@@ -71,7 +70,6 @@ pub use crate::{
71 ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile}, 70 ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile},
72 impl_block::ImplBlock, 71 impl_block::ImplBlock,
73 nameres::{ImportId, Namespace, PerNs}, 72 nameres::{ImportId, Namespace, PerNs},
74 path::{Path, PathKind},
75 resolve::ScopeDef, 73 resolve::ScopeDef,
76 source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer}, 74 source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer},
77 ty::{ 75 ty::{
@@ -88,4 +86,7 @@ pub use self::code_model::{
88 ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union, 86 ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
89}; 87};
90 88
91pub use hir_def::name::Name; 89pub use hir_def::{
90 name::Name,
91 path::{Path, PathKind},
92};
diff --git a/crates/ra_hir/src/path.rs b/crates/ra_hir/src/path.rs
deleted file mode 100644
index 7f0ff4bfc..000000000
--- a/crates/ra_hir/src/path.rs
+++ /dev/null
@@ -1 +0,0 @@
1pub use hir_def::path::*;
diff --git a/crates/ra_hir/src/resolve.rs b/crates/ra_hir/src/resolve.rs
index b9459552b..2a783b61e 100644
--- a/crates/ra_hir/src/resolve.rs
+++ b/crates/ra_hir/src/resolve.rs
@@ -3,6 +3,7 @@ use std::sync::Arc;
3 3
4use hir_def::{ 4use hir_def::{
5 name::{self, Name}, 5 name::{self, Name},
6 path::{Path, PathKind},
6 CrateModuleId, 7 CrateModuleId,
7}; 8};
8use rustc_hash::FxHashSet; 9use rustc_hash::FxHashSet;
@@ -17,7 +18,6 @@ use crate::{
17 generics::GenericParams, 18 generics::GenericParams,
18 impl_block::ImplBlock, 19 impl_block::ImplBlock,
19 nameres::{CrateDefMap, PerNs}, 20 nameres::{CrateDefMap, PerNs},
20 path::{Path, PathKind},
21 Adt, BuiltinType, Const, Enum, EnumVariant, Function, MacroDef, ModuleDef, Static, Struct, 21 Adt, BuiltinType, Const, Enum, EnumVariant, Function, MacroDef, ModuleDef, Static, Struct,
22 Trait, TypeAlias, 22 Trait, TypeAlias,
23}; 23};
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index 8a1fa29a4..544433a0a 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -7,7 +7,7 @@
7//! purely for "IDE needs". 7//! purely for "IDE needs".
8use std::sync::Arc; 8use std::sync::Arc;
9 9
10use hir_def::name::AsName; 10use hir_def::{name::AsName, path::known};
11use ra_db::FileId; 11use ra_db::FileId;
12use ra_syntax::{ 12use ra_syntax::{
13 ast::{self, AstNode}, 13 ast::{self, AstNode},
@@ -25,7 +25,6 @@ use crate::{
25 BodySourceMap, 25 BodySourceMap,
26 }, 26 },
27 ids::LocationCtx, 27 ids::LocationCtx,
28 path::known,
29 resolve::{ScopeDef, TypeNs, ValueNs}, 28 resolve::{ScopeDef, TypeNs, ValueNs},
30 ty::method_resolution::implements_trait, 29 ty::method_resolution::implements_trait,
31 Const, DefWithBody, Either, Enum, FromSource, Function, HasBody, HirFileId, MacroDef, Module, 30 Const, DefWithBody, Either, Enum, FromSource, Function, HasBody, HirFileId, MacroDef, Module,
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 92b8e718e..05c6b5aad 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -21,7 +21,7 @@ use std::sync::Arc;
21use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; 21use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue};
22use rustc_hash::FxHashMap; 22use rustc_hash::FxHashMap;
23 23
24use hir_def::name; 24use hir_def::{name, path::known};
25use ra_arena::map::ArenaMap; 25use ra_arena::map::ArenaMap;
26use ra_prof::profile; 26use ra_prof::profile;
27use test_utils::tested_by; 27use test_utils::tested_by;
@@ -38,7 +38,6 @@ use crate::{
38 db::HirDatabase, 38 db::HirDatabase,
39 diagnostics::DiagnosticSink, 39 diagnostics::DiagnosticSink,
40 expr::{BindingAnnotation, Body, ExprId, PatId}, 40 expr::{BindingAnnotation, Body, ExprId, PatId},
41 path::known,
42 resolve::{Resolver, TypeNs}, 41 resolve::{Resolver, TypeNs},
43 ty::infer::diagnostics::InferenceDiagnostic, 42 ty::infer::diagnostics::InferenceDiagnostic,
44 type_ref::{Mutability, TypeRef}, 43 type_ref::{Mutability, TypeRef},
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs
index 7ef87bfe2..bc6437b44 100644
--- a/crates/ra_hir/src/ty/infer/expr.rs
+++ b/crates/ra_hir/src/ty/infer/expr.rs
@@ -3,7 +3,10 @@
3use std::iter::{repeat, repeat_with}; 3use std::iter::{repeat, repeat_with};
4use std::sync::Arc; 4use std::sync::Arc;
5 5
6use hir_def::name; 6use hir_def::{
7 name,
8 path::{GenericArg, GenericArgs},
9};
7 10
8use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; 11use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch};
9use crate::{ 12use crate::{
@@ -11,7 +14,6 @@ use crate::{
11 expr::{self, Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, 14 expr::{self, Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
12 generics::{GenericParams, HasGenericParams}, 15 generics::{GenericParams, HasGenericParams},
13 nameres::Namespace, 16 nameres::Namespace,
14 path::{GenericArg, GenericArgs},
15 ty::{ 17 ty::{
16 autoderef, method_resolution, op, primitive, CallableDef, InferTy, Mutability, Obligation, 18 autoderef, method_resolution, op, primitive, CallableDef, InferTy, Mutability, Obligation,
17 ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk, 19 ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, TypeWalk,
diff --git a/crates/ra_hir/src/ty/infer/path.rs b/crates/ra_hir/src/ty/infer/path.rs
index db979353a..77aa35ce1 100644
--- a/crates/ra_hir/src/ty/infer/path.rs
+++ b/crates/ra_hir/src/ty/infer/path.rs
@@ -1,5 +1,7 @@
1//! Path expression resolution. 1//! Path expression resolution.
2 2
3use hir_def::path::PathSegment;
4
3use super::{ExprOrPatId, InferenceContext, TraitRef}; 5use super::{ExprOrPatId, InferenceContext, TraitRef};
4use crate::{ 6use crate::{
5 db::HirDatabase, 7 db::HirDatabase,
@@ -131,7 +133,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
131 fn resolve_trait_assoc_item( 133 fn resolve_trait_assoc_item(
132 &mut self, 134 &mut self,
133 trait_ref: TraitRef, 135 trait_ref: TraitRef,
134 segment: &crate::path::PathSegment, 136 segment: &PathSegment,
135 id: ExprOrPatId, 137 id: ExprOrPatId,
136 ) -> Option<(ValueNs, Option<Substs>)> { 138 ) -> Option<(ValueNs, Option<Substs>)> {
137 let trait_ = trait_ref.trait_; 139 let trait_ = trait_ref.trait_;
@@ -170,7 +172,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
170 fn resolve_ty_assoc_item( 172 fn resolve_ty_assoc_item(
171 &mut self, 173 &mut self,
172 ty: Ty, 174 ty: Ty,
173 segment: &crate::path::PathSegment, 175 segment: &PathSegment,
174 id: ExprOrPatId, 176 id: ExprOrPatId,
175 ) -> Option<(ValueNs, Option<Substs>)> { 177 ) -> Option<(ValueNs, Option<Substs>)> {
176 if let Ty::Unknown = ty { 178 if let Ty::Unknown = ty {
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index 366556134..b131b306c 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -8,6 +8,8 @@
8use std::iter; 8use std::iter;
9use std::sync::Arc; 9use std::sync::Arc;
10 10
11use hir_def::path::{GenericArg, PathSegment};
12
11use super::{ 13use super::{
12 FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, 14 FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor,
13 TypeWalk, 15 TypeWalk,
@@ -18,7 +20,6 @@ use crate::{
18 generics::HasGenericParams, 20 generics::HasGenericParams,
19 generics::{GenericDef, WherePredicate}, 21 generics::{GenericDef, WherePredicate},
20 nameres::Namespace, 22 nameres::Namespace,
21 path::{GenericArg, PathSegment},
22 resolve::{Resolver, TypeNs}, 23 resolve::{Resolver, TypeNs},
23 ty::Adt, 24 ty::Adt,
24 type_ref::{TypeBound, TypeRef}, 25 type_ref::{TypeBound, TypeRef},