aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-30 14:28:30 +0000
committerAleksey Kladov <[email protected]>2019-10-30 14:43:14 +0000
commite5300ad3baf80c9903235a98a12b6cfd409e9f10 (patch)
treead15ef9afdda85d9978fa2e4fccbc890723fab08 /crates
parente56433432057712086ca623c4a1ef40089004839 (diff)
remove forward pointer for type_ref
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/adt.rs3
-rw-r--r--crates/ra_hir/src/code_model.rs3
-rw-r--r--crates/ra_hir/src/expr.rs6
-rw-r--r--crates/ra_hir/src/expr/lower.rs2
-rw-r--r--crates/ra_hir/src/generics.rs2
-rw-r--r--crates/ra_hir/src/impl_block.rs2
-rw-r--r--crates/ra_hir/src/lib.rs3
-rw-r--r--crates/ra_hir/src/ty.rs4
-rw-r--r--crates/ra_hir/src/ty/infer.rs7
-rw-r--r--crates/ra_hir/src/ty/infer/coerce.rs3
-rw-r--r--crates/ra_hir/src/ty/lower.rs6
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs3
-rw-r--r--crates/ra_hir/src/type_alias.rs6
-rw-r--r--crates/ra_hir/src/type_ref.rs1
14 files changed, 27 insertions, 24 deletions
diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs
index ce64980bb..d16b3a1cc 100644
--- a/crates/ra_hir/src/adt.rs
+++ b/crates/ra_hir/src/adt.rs
@@ -3,13 +3,12 @@
3 3
4use std::sync::Arc; 4use std::sync::Arc;
5 5
6use hir_def::name::AsName; 6use hir_def::{name::AsName, type_ref::TypeRef};
7use ra_arena::{impl_arena_id, Arena, RawId}; 7use ra_arena::{impl_arena_id, Arena, RawId};
8use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner}; 8use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner};
9 9
10use crate::{ 10use crate::{
11 db::{AstDatabase, DefDatabase, HirDatabase}, 11 db::{AstDatabase, DefDatabase, HirDatabase},
12 type_ref::TypeRef,
13 Enum, EnumVariant, FieldSource, HasSource, Module, Name, Source, Struct, StructField, 12 Enum, EnumVariant, FieldSource, HasSource, Module, Name, Source, Struct, StructField,
14}; 13};
15 14
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 7848d0a3f..d865c972e 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -10,6 +10,7 @@ use hir_def::{
10 self, AsName, BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128, 10 self, AsName, BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128,
11 U16, U32, U64, U8, USIZE, 11 U16, U32, U64, U8, USIZE,
12 }, 12 },
13 type_ref::{Mutability, TypeRef},
13 CrateModuleId, ModuleId, 14 CrateModuleId, ModuleId,
14}; 15};
15use ra_db::{CrateId, Edition}; 16use ra_db::{CrateId, Edition};
@@ -33,8 +34,6 @@ use crate::{
33 primitive::{FloatBitness, FloatTy, IntBitness, IntTy, Signedness}, 34 primitive::{FloatBitness, FloatTy, IntBitness, IntTy, Signedness},
34 InferenceResult, TraitRef, 35 InferenceResult, TraitRef,
35 }, 36 },
36 type_ref::Mutability,
37 type_ref::TypeRef,
38 Either, HasSource, Name, Ty, 37 Either, HasSource, Name, Ty,
39}; 38};
40 39
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index 31857ad56..6e23197a4 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -6,7 +6,10 @@ 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 hir_def::{
10 path::GenericArgs,
11 type_ref::{Mutability, TypeRef},
12};
10use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; 13use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId};
11use ra_syntax::{ast, AstPtr}; 14use ra_syntax::{ast, AstPtr};
12use rustc_hash::FxHashMap; 15use rustc_hash::FxHashMap;
@@ -14,7 +17,6 @@ use rustc_hash::FxHashMap;
14use crate::{ 17use crate::{
15 db::HirDatabase, 18 db::HirDatabase,
16 ty::primitive::{UncertainFloatTy, UncertainIntTy}, 19 ty::primitive::{UncertainFloatTy, UncertainIntTy},
17 type_ref::{Mutability, TypeRef},
18 DefWithBody, Either, HasSource, Name, Path, Resolver, Source, 20 DefWithBody, Either, HasSource, Name, Path, Resolver, Source,
19}; 21};
20 22
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs
index 6436c3a24..ad029b868 100644
--- a/crates/ra_hir/src/expr/lower.rs
+++ b/crates/ra_hir/src/expr/lower.rs
@@ -3,6 +3,7 @@
3use hir_def::{ 3use hir_def::{
4 name::{self, AsName, Name}, 4 name::{self, AsName, Name},
5 path::GenericArgs, 5 path::GenericArgs,
6 type_ref::TypeRef,
6}; 7};
7use ra_arena::Arena; 8use ra_arena::Arena;
8use ra_syntax::{ 9use ra_syntax::{
@@ -17,7 +18,6 @@ use test_utils::tested_by;
17use crate::{ 18use crate::{
18 db::HirDatabase, 19 db::HirDatabase,
19 ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, 20 ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy},
20 type_ref::TypeRef,
21 AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver, 21 AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver,
22 Source, 22 Source,
23}; 23};
diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs
index 45f9713a0..9d5d18564 100644
--- a/crates/ra_hir/src/generics.rs
+++ b/crates/ra_hir/src/generics.rs
@@ -8,12 +8,12 @@ use std::sync::Arc;
8use hir_def::{ 8use hir_def::{
9 name::{self, AsName}, 9 name::{self, AsName},
10 path::Path, 10 path::Path,
11 type_ref::{TypeBound, TypeRef},
11}; 12};
12use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner}; 13use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner};
13 14
14use crate::{ 15use crate::{
15 db::{AstDatabase, DefDatabase, HirDatabase}, 16 db::{AstDatabase, DefDatabase, HirDatabase},
16 type_ref::{TypeBound, TypeRef},
17 Adt, Const, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, Trait, 17 Adt, Const, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, Trait,
18 TypeAlias, Union, 18 TypeAlias, Union,
19}; 19};
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs
index 06f21fc33..8584686fd 100644
--- a/crates/ra_hir/src/impl_block.rs
+++ b/crates/ra_hir/src/impl_block.rs
@@ -3,6 +3,7 @@
3use rustc_hash::FxHashMap; 3use rustc_hash::FxHashMap;
4use std::sync::Arc; 4use std::sync::Arc;
5 5
6use hir_def::type_ref::TypeRef;
6use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; 7use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId};
7use ra_cfg::CfgOptions; 8use ra_cfg::CfgOptions;
8use ra_syntax::{ 9use ra_syntax::{
@@ -19,7 +20,6 @@ use crate::{
19 ids::MacroCallLoc, 20 ids::MacroCallLoc,
20 resolve::Resolver, 21 resolve::Resolver,
21 ty::Ty, 22 ty::Ty,
22 type_ref::TypeRef,
23 AssocItem, AstId, Const, Function, HasSource, HirFileId, MacroFileKind, Path, Source, TraitRef, 23 AssocItem, AstId, Const, Function, HasSource, HirFileId, MacroFileKind, Path, Source, TraitRef,
24 TypeAlias, 24 TypeAlias,
25}; 25};
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index e723a1f40..4dd99c74f 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -39,7 +39,6 @@ mod nameres;
39mod adt; 39mod adt;
40mod traits; 40mod traits;
41mod type_alias; 41mod type_alias;
42mod type_ref;
43mod ty; 42mod ty;
44mod attr; 43mod attr;
45mod impl_block; 44mod impl_block;
@@ -75,7 +74,6 @@ pub use crate::{
75 ty::{ 74 ty::{
76 display::HirDisplay, ApplicationTy, CallableDef, Substs, TraitRef, Ty, TypeCtor, TypeWalk, 75 display::HirDisplay, ApplicationTy, CallableDef, Substs, TraitRef, Ty, TypeCtor, TypeWalk,
77 }, 76 },
78 type_ref::Mutability,
79}; 77};
80 78
81pub use self::code_model::{ 79pub use self::code_model::{
@@ -89,4 +87,5 @@ pub use self::code_model::{
89pub use hir_def::{ 87pub use hir_def::{
90 name::Name, 88 name::Name,
91 path::{Path, PathKind}, 89 path::{Path, PathKind},
90 type_ref::Mutability,
92}; 91};
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index cc9746f6d..d2bfcdc7d 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -17,8 +17,8 @@ use std::sync::Arc;
17use std::{fmt, iter, mem}; 17use std::{fmt, iter, mem};
18 18
19use crate::{ 19use crate::{
20 db::HirDatabase, expr::ExprId, type_ref::Mutability, util::make_mut_slice, Adt, Crate, 20 db::HirDatabase, expr::ExprId, util::make_mut_slice, Adt, Crate, DefWithBody, GenericParams,
21 DefWithBody, GenericParams, HasGenericParams, Name, Trait, TypeAlias, 21 HasGenericParams, Mutability, Name, Trait, TypeAlias,
22}; 22};
23use display::{HirDisplay, HirFormatter}; 23use display::{HirDisplay, HirFormatter};
24 24
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 05c6b5aad..7466ee341 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -21,7 +21,11 @@ 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, path::known}; 24use hir_def::{
25 name,
26 path::known,
27 type_ref::{Mutability, TypeRef},
28};
25use ra_arena::map::ArenaMap; 29use ra_arena::map::ArenaMap;
26use ra_prof::profile; 30use ra_prof::profile;
27use test_utils::tested_by; 31use test_utils::tested_by;
@@ -40,7 +44,6 @@ use crate::{
40 expr::{BindingAnnotation, Body, ExprId, PatId}, 44 expr::{BindingAnnotation, Body, ExprId, PatId},
41 resolve::{Resolver, TypeNs}, 45 resolve::{Resolver, TypeNs},
42 ty::infer::diagnostics::InferenceDiagnostic, 46 ty::infer::diagnostics::InferenceDiagnostic,
43 type_ref::{Mutability, TypeRef},
44 Adt, AssocItem, ConstData, DefWithBody, FnData, Function, HasBody, Path, StructField, 47 Adt, AssocItem, ConstData, DefWithBody, FnData, Function, HasBody, Path, StructField,
45}; 48};
46 49
diff --git a/crates/ra_hir/src/ty/infer/coerce.rs b/crates/ra_hir/src/ty/infer/coerce.rs
index 0429a9866..6ea135126 100644
--- a/crates/ra_hir/src/ty/infer/coerce.rs
+++ b/crates/ra_hir/src/ty/infer/coerce.rs
@@ -14,8 +14,7 @@ use crate::{
14 lang_item::LangItemTarget, 14 lang_item::LangItemTarget,
15 resolve::Resolver, 15 resolve::Resolver,
16 ty::{autoderef, Substs, Ty, TypeCtor, TypeWalk}, 16 ty::{autoderef, Substs, Ty, TypeCtor, TypeWalk},
17 type_ref::Mutability, 17 Adt, Mutability,
18 Adt,
19}; 18};
20 19
21impl<'a, D: HirDatabase> InferenceContext<'a, D> { 20impl<'a, D: HirDatabase> InferenceContext<'a, D> {
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index b131b306c..0f49a0e54 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -8,7 +8,10 @@
8use std::iter; 8use std::iter;
9use std::sync::Arc; 9use std::sync::Arc;
10 10
11use hir_def::path::{GenericArg, PathSegment}; 11use hir_def::{
12 path::{GenericArg, PathSegment},
13 type_ref::{TypeBound, TypeRef},
14};
12 15
13use super::{ 16use super::{
14 FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, 17 FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor,
@@ -22,7 +25,6 @@ use crate::{
22 nameres::Namespace, 25 nameres::Namespace,
23 resolve::{Resolver, TypeNs}, 26 resolve::{Resolver, TypeNs},
24 ty::Adt, 27 ty::Adt,
25 type_ref::{TypeBound, TypeRef},
26 util::make_mut_slice, 28 util::make_mut_slice,
27 BuiltinType, Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, 29 BuiltinType, Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField,
28 Trait, TypeAlias, Union, 30 Trait, TypeAlias, Union,
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index 50583a142..eb69344f6 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -15,8 +15,7 @@ use crate::{
15 resolve::Resolver, 15 resolve::Resolver,
16 ty::primitive::{FloatBitness, UncertainFloatTy, UncertainIntTy}, 16 ty::primitive::{FloatBitness, UncertainFloatTy, UncertainIntTy},
17 ty::{Ty, TypeCtor}, 17 ty::{Ty, TypeCtor},
18 type_ref::Mutability, 18 AssocItem, Crate, Function, Module, Mutability, Name, Trait,
19 AssocItem, Crate, Function, Module, Name, Trait,
20}; 19};
21 20
22/// This is used as a key for indexing impls. 21/// This is used as a key for indexing impls.
diff --git a/crates/ra_hir/src/type_alias.rs b/crates/ra_hir/src/type_alias.rs
index 18c01e1b9..87126ee7f 100644
--- a/crates/ra_hir/src/type_alias.rs
+++ b/crates/ra_hir/src/type_alias.rs
@@ -2,12 +2,14 @@
2 2
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use hir_def::name::{AsName, Name}; 5use hir_def::{
6 name::{AsName, Name},
7 type_ref::TypeRef,
8};
6use ra_syntax::ast::NameOwner; 9use ra_syntax::ast::NameOwner;
7 10
8use crate::{ 11use crate::{
9 db::{AstDatabase, DefDatabase}, 12 db::{AstDatabase, DefDatabase},
10 type_ref::TypeRef,
11 HasSource, TypeAlias, 13 HasSource, TypeAlias,
12}; 14};
13 15
diff --git a/crates/ra_hir/src/type_ref.rs b/crates/ra_hir/src/type_ref.rs
deleted file mode 100644
index bd56ddbe6..000000000
--- a/crates/ra_hir/src/type_ref.rs
+++ /dev/null
@@ -1 +0,0 @@
1pub use hir_def::type_ref::*;