Skip to content

Commit 77d974a

Browse files
committed
Replace all the types by their Chalk versions
1 parent 855a739 commit 77d974a

File tree

3 files changed

+32
-554
lines changed

3 files changed

+32
-554
lines changed

crates/hir_ty/src/lib.rs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ mod chalk_cast;
1717
mod chalk_ext;
1818
mod builder;
1919
mod walk;
20-
mod types;
2120

2221
pub mod display;
2322
pub mod db;
@@ -48,7 +47,6 @@ pub use lower::{
4847
TyDefId, TyLoweringContext, ValueTyDefId,
4948
};
5049
pub use traits::{chalk::Interner, TraitEnvironment};
51-
pub use types::*;
5250
pub use walk::TypeWalk;
5351

5452
pub use chalk_ir::{
@@ -65,6 +63,21 @@ pub type PlaceholderIndex = chalk_ir::PlaceholderIndex;
6563
pub type VariableKind = chalk_ir::VariableKind<Interner>;
6664
pub type VariableKinds = chalk_ir::VariableKinds<Interner>;
6765
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;
6881

6982
pub type Lifetime = chalk_ir::Lifetime<Interner>;
7083
pub type LifetimeData = chalk_ir::LifetimeData<Interner>;
@@ -79,6 +92,14 @@ pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
7992

8093
pub type FnSig = chalk_ir::FnSig<Interner>;
8194

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+
82103
// FIXME: get rid of this
83104
pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution {
84105
Substitution::intern(s.interned()[..std::cmp::min(s.len(&Interner), n)].into())
@@ -121,6 +142,14 @@ pub fn make_canonical<T>(
121142
Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) }
122143
}
123144

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+
124153
/// A function signature as seen by type inference: Several parameter types and
125154
/// one return type.
126155
#[derive(Clone, PartialEq, Eq, Debug)]
@@ -164,8 +193,6 @@ impl CallableSig {
164193
}
165194
}
166195

167-
impl Ty {}
168-
169196
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
170197
pub enum ImplTraitId {
171198
ReturnTypeImplTrait(hir_def::FunctionId, u16),

0 commit comments

Comments
 (0)