diff options
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 87f10e9d5..3378015ca 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -17,7 +17,6 @@ mod chalk_cast; | |||
17 | mod chalk_ext; | 17 | mod chalk_ext; |
18 | mod builder; | 18 | mod builder; |
19 | mod walk; | 19 | mod walk; |
20 | mod types; | ||
21 | 20 | ||
22 | pub mod display; | 21 | pub mod display; |
23 | pub mod db; | 22 | pub mod db; |
@@ -48,7 +47,6 @@ pub use lower::{ | |||
48 | TyDefId, TyLoweringContext, ValueTyDefId, | 47 | TyDefId, TyLoweringContext, ValueTyDefId, |
49 | }; | 48 | }; |
50 | pub use traits::{chalk::Interner, TraitEnvironment}; | 49 | pub use traits::{chalk::Interner, TraitEnvironment}; |
51 | pub use types::*; | ||
52 | pub use walk::TypeWalk; | 50 | pub use walk::TypeWalk; |
53 | 51 | ||
54 | pub use chalk_ir::{ | 52 | pub use chalk_ir::{ |
@@ -65,6 +63,21 @@ pub type PlaceholderIndex = chalk_ir::PlaceholderIndex; | |||
65 | pub type VariableKind = chalk_ir::VariableKind<Interner>; | 63 | pub type VariableKind = chalk_ir::VariableKind<Interner>; |
66 | pub type VariableKinds = chalk_ir::VariableKinds<Interner>; | 64 | pub type VariableKinds = chalk_ir::VariableKinds<Interner>; |
67 | pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>; | 65 | pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>; |
66 | pub type Binders<T> = chalk_ir::Binders<T>; | ||
67 | pub type Substitution = chalk_ir::Substitution<Interner>; | ||
68 | pub type GenericArg = chalk_ir::GenericArg<Interner>; | ||
69 | pub type GenericArgData = chalk_ir::GenericArgData<Interner>; | ||
70 | |||
71 | pub type Ty = chalk_ir::Ty<Interner>; | ||
72 | pub type TyKind = chalk_ir::TyKind<Interner>; | ||
73 | pub type DynTy = chalk_ir::DynTy<Interner>; | ||
74 | pub type FnPointer = chalk_ir::FnPointer<Interner>; | ||
75 | // pub type FnSubst = chalk_ir::FnSubst<Interner>; | ||
76 | pub use chalk_ir::FnSubst; | ||
77 | pub type ProjectionTy = chalk_ir::ProjectionTy<Interner>; | ||
78 | pub type AliasTy = chalk_ir::AliasTy<Interner>; | ||
79 | pub type OpaqueTy = chalk_ir::OpaqueTy<Interner>; | ||
80 | pub type InferenceVar = chalk_ir::InferenceVar; | ||
68 | 81 | ||
69 | pub type Lifetime = chalk_ir::Lifetime<Interner>; | 82 | pub type Lifetime = chalk_ir::Lifetime<Interner>; |
70 | pub type LifetimeData = chalk_ir::LifetimeData<Interner>; | 83 | pub type LifetimeData = chalk_ir::LifetimeData<Interner>; |
@@ -79,6 +92,14 @@ pub type ChalkTraitId = chalk_ir::TraitId<Interner>; | |||
79 | 92 | ||
80 | pub type FnSig = chalk_ir::FnSig<Interner>; | 93 | pub type FnSig = chalk_ir::FnSig<Interner>; |
81 | 94 | ||
95 | pub type InEnvironment<T> = chalk_ir::InEnvironment<T>; | ||
96 | pub type DomainGoal = chalk_ir::DomainGoal<Interner>; | ||
97 | pub type AliasEq = chalk_ir::AliasEq<Interner>; | ||
98 | pub type Solution = chalk_solve::Solution<Interner>; | ||
99 | pub type ConstrainedSubst = chalk_ir::ConstrainedSubst<Interner>; | ||
100 | pub type Guidance = chalk_solve::Guidance<Interner>; | ||
101 | pub type WhereClause = chalk_ir::WhereClause<Interner>; | ||
102 | |||
82 | // FIXME: get rid of this | 103 | // FIXME: get rid of this |
83 | pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { | 104 | pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { |
84 | Substitution::intern(s.interned()[..std::cmp::min(s.len(&Interner), n)].into()) | 105 | Substitution::intern(s.interned()[..std::cmp::min(s.len(&Interner), n)].into()) |
@@ -121,6 +142,14 @@ pub fn make_canonical<T>( | |||
121 | Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) } | 142 | Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) } |
122 | } | 143 | } |
123 | 144 | ||
145 | pub type TraitRef = chalk_ir::TraitRef<Interner>; | ||
146 | |||
147 | pub type QuantifiedWhereClause = Binders<WhereClause>; | ||
148 | |||
149 | pub type QuantifiedWhereClauses = chalk_ir::QuantifiedWhereClauses<Interner>; | ||
150 | |||
151 | pub type Canonical<T> = chalk_ir::Canonical<T>; | ||
152 | |||
124 | /// A function signature as seen by type inference: Several parameter types and | 153 | /// A function signature as seen by type inference: Several parameter types and |
125 | /// one return type. | 154 | /// one return type. |
126 | #[derive(Clone, PartialEq, Eq, Debug)] | 155 | #[derive(Clone, PartialEq, Eq, Debug)] |
@@ -164,8 +193,6 @@ impl CallableSig { | |||
164 | } | 193 | } |
165 | } | 194 | } |
166 | 195 | ||
167 | impl Ty {} | ||
168 | |||
169 | #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] | 196 | #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] |
170 | pub enum ImplTraitId { | 197 | pub enum ImplTraitId { |
171 | ReturnTypeImplTrait(hir_def::FunctionId, u16), | 198 | ReturnTypeImplTrait(hir_def::FunctionId, u16), |