aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs35
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;
17mod chalk_ext; 17mod chalk_ext;
18mod builder; 18mod builder;
19mod walk; 19mod walk;
20mod types;
21 20
22pub mod display; 21pub mod display;
23pub mod db; 22pub mod db;
@@ -48,7 +47,6 @@ pub use lower::{
48 TyDefId, TyLoweringContext, ValueTyDefId, 47 TyDefId, TyLoweringContext, ValueTyDefId,
49}; 48};
50pub use traits::{chalk::Interner, TraitEnvironment}; 49pub use traits::{chalk::Interner, TraitEnvironment};
51pub use types::*;
52pub use walk::TypeWalk; 50pub use walk::TypeWalk;
53 51
54pub use chalk_ir::{ 52pub use chalk_ir::{
@@ -65,6 +63,21 @@ pub type PlaceholderIndex = chalk_ir::PlaceholderIndex;
65pub type VariableKind = chalk_ir::VariableKind<Interner>; 63pub type VariableKind = chalk_ir::VariableKind<Interner>;
66pub type VariableKinds = chalk_ir::VariableKinds<Interner>; 64pub type VariableKinds = chalk_ir::VariableKinds<Interner>;
67pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>; 65pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>;
66pub type Binders<T> = chalk_ir::Binders<T>;
67pub type Substitution = chalk_ir::Substitution<Interner>;
68pub type GenericArg = chalk_ir::GenericArg<Interner>;
69pub type GenericArgData = chalk_ir::GenericArgData<Interner>;
70
71pub type Ty = chalk_ir::Ty<Interner>;
72pub type TyKind = chalk_ir::TyKind<Interner>;
73pub type DynTy = chalk_ir::DynTy<Interner>;
74pub type FnPointer = chalk_ir::FnPointer<Interner>;
75// pub type FnSubst = chalk_ir::FnSubst<Interner>;
76pub use chalk_ir::FnSubst;
77pub type ProjectionTy = chalk_ir::ProjectionTy<Interner>;
78pub type AliasTy = chalk_ir::AliasTy<Interner>;
79pub type OpaqueTy = chalk_ir::OpaqueTy<Interner>;
80pub type InferenceVar = chalk_ir::InferenceVar;
68 81
69pub type Lifetime = chalk_ir::Lifetime<Interner>; 82pub type Lifetime = chalk_ir::Lifetime<Interner>;
70pub type LifetimeData = chalk_ir::LifetimeData<Interner>; 83pub type LifetimeData = chalk_ir::LifetimeData<Interner>;
@@ -79,6 +92,14 @@ pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
79 92
80pub type FnSig = chalk_ir::FnSig<Interner>; 93pub type FnSig = chalk_ir::FnSig<Interner>;
81 94
95pub type InEnvironment<T> = chalk_ir::InEnvironment<T>;
96pub type DomainGoal = chalk_ir::DomainGoal<Interner>;
97pub type AliasEq = chalk_ir::AliasEq<Interner>;
98pub type Solution = chalk_solve::Solution<Interner>;
99pub type ConstrainedSubst = chalk_ir::ConstrainedSubst<Interner>;
100pub type Guidance = chalk_solve::Guidance<Interner>;
101pub type WhereClause = chalk_ir::WhereClause<Interner>;
102
82// FIXME: get rid of this 103// FIXME: get rid of this
83pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { 104pub 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
145pub type TraitRef = chalk_ir::TraitRef<Interner>;
146
147pub type QuantifiedWhereClause = Binders<WhereClause>;
148
149pub type QuantifiedWhereClauses = chalk_ir::QuantifiedWhereClauses<Interner>;
150
151pub 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
167impl Ty {}
168
169#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] 196#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
170pub enum ImplTraitId { 197pub enum ImplTraitId {
171 ReturnTypeImplTrait(hir_def::FunctionId, u16), 198 ReturnTypeImplTrait(hir_def::FunctionId, u16),