Skip to content

Commit 8a2c482

Browse files
committed
More cleanups
1 parent 2f02977 commit 8a2c482

File tree

3 files changed

+29
-38
lines changed

3 files changed

+29
-38
lines changed

crates/hir_ty/src/chalk_cast.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

crates/hir_ty/src/interner.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,12 @@ impl chalk_ir::interner::Interner for Interner {
412412
impl chalk_ir::interner::HasInterner for Interner {
413413
type Interner = Self;
414414
}
415+
416+
#[macro_export]
417+
macro_rules! has_interner {
418+
($t:ty) => {
419+
impl HasInterner for $t {
420+
type Interner = crate::Interner;
421+
}
422+
};
423+
}

crates/hir_ty/src/lib.rs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,23 @@ macro_rules! eprintln {
77
}
88

99
mod autoderef;
10-
pub mod primitive;
11-
pub mod traits;
12-
pub mod method_resolution;
13-
mod op;
14-
mod lower;
15-
pub(crate) mod infer;
16-
pub(crate) mod utils;
17-
mod chalk_cast;
18-
mod chalk_ext;
1910
mod builder;
20-
mod walk;
21-
mod tls;
11+
mod chalk_db;
12+
mod chalk_ext;
13+
mod infer;
2214
mod interner;
15+
mod lower;
2316
mod mapping;
24-
mod chalk_db;
25-
26-
pub mod display;
17+
mod op;
18+
mod tls;
19+
mod utils;
20+
mod walk;
2721
pub mod db;
2822
pub mod diagnostics;
23+
pub mod display;
24+
pub mod method_resolution;
25+
pub mod primitive;
26+
pub mod traits;
2927

3028
#[cfg(test)]
3129
mod tests;
@@ -100,6 +98,10 @@ pub type ConstValue = chalk_ir::ConstValue<Interner>;
10098
pub type ConcreteConst = chalk_ir::ConcreteConst<Interner>;
10199

102100
pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
101+
pub type TraitRef = chalk_ir::TraitRef<Interner>;
102+
pub type QuantifiedWhereClause = Binders<WhereClause>;
103+
pub type QuantifiedWhereClauses = chalk_ir::QuantifiedWhereClauses<Interner>;
104+
pub type Canonical<T> = chalk_ir::Canonical<T>;
103105

104106
pub type FnSig = chalk_ir::FnSig<Interner>;
105107

@@ -159,14 +161,6 @@ pub fn make_canonical<T: HasInterner<Interner = Interner>>(
159161
Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) }
160162
}
161163

162-
pub type TraitRef = chalk_ir::TraitRef<Interner>;
163-
164-
pub type QuantifiedWhereClause = Binders<WhereClause>;
165-
166-
pub type QuantifiedWhereClauses = chalk_ir::QuantifiedWhereClauses<Interner>;
167-
168-
pub type Canonical<T> = chalk_ir::Canonical<T>;
169-
170164
/// A function signature as seen by type inference: Several parameter types and
171165
/// one return type.
172166
#[derive(Clone, PartialEq, Eq, Debug)]
@@ -175,6 +169,8 @@ pub struct CallableSig {
175169
is_varargs: bool,
176170
}
177171

172+
has_interner!(CallableSig);
173+
178174
/// A polymorphic function signature.
179175
pub type PolyFnSig = Binders<CallableSig>;
180176

@@ -238,6 +234,8 @@ pub struct ReturnTypeImplTraits {
238234
pub(crate) impl_traits: Vec<ReturnTypeImplTrait>,
239235
}
240236

237+
has_interner!(ReturnTypeImplTraits);
238+
241239
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
242240
pub(crate) struct ReturnTypeImplTrait {
243241
pub(crate) bounds: Binders<Vec<QuantifiedWhereClause>>,

0 commit comments

Comments
 (0)