Skip to content

Commit e99d08f

Browse files
committed
Review comments
1 parent 5a591ee commit e99d08f

File tree

4 files changed

+13
-50
lines changed

4 files changed

+13
-50
lines changed

chalk-engine/src/boring_impls.rs

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -151,48 +151,11 @@ impl<I: Interner> Visit<I> for Literal<I> {
151151
}
152152
}
153153

154-
// FIXME: I can't figure out macro visibility rules
155-
macro_rules! copy_fold {
156-
($t:ty) => {
157-
impl<I: Interner, TI: TargetInterner<I>> chalk_ir::fold::Fold<I, TI> for $t {
158-
type Result = Self;
159-
fn fold_with<'i>(
160-
&self,
161-
_folder: &mut dyn (chalk_ir::fold::Folder<'i, I, TI>),
162-
_outer_binder: DebruijnIndex,
163-
) -> chalk_base::results::Fallible<Self::Result>
164-
where
165-
I: 'i,
166-
TI: 'i,
167-
{
168-
Ok(*self)
169-
}
170-
}
171-
};
172-
}
173-
174-
copy_fold!(crate::TableIndex);
175-
copy_fold!(crate::TimeStamp);
176-
177-
macro_rules! const_visit {
178-
($t:ty) => {
179-
impl<I: Interner> chalk_ir::visit::Visit<I> for $t {
180-
fn visit_with<'i, R: VisitResult>(
181-
&self,
182-
_visitor: &mut dyn (chalk_ir::visit::Visitor<'i, I, Result = R>),
183-
_outer_binder: DebruijnIndex,
184-
) -> R
185-
where
186-
I: 'i,
187-
{
188-
R::new()
189-
}
190-
}
191-
};
192-
}
154+
chalk_ir::copy_fold!(crate::TableIndex);
155+
chalk_ir::copy_fold!(crate::TimeStamp);
193156

194-
const_visit!(crate::TableIndex);
195-
const_visit!(crate::TimeStamp);
157+
chalk_ir::const_visit!(crate::TableIndex);
158+
chalk_ir::const_visit!(crate::TimeStamp);
196159

197160
impl<I: Interner> HasInterner for ExClause<I> {
198161
type Interner = I;

chalk-engine/src/logic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ impl<I: Interner, C: Context<I>> Forest<I, C> {
286286
}
287287

288288
_ => {
289-
// `canonical_goal` is an HH goal. We can simplify it
289+
// `canonical_goal` is a goal. We can simplify it
290290
// into a series of *literals*, all of which must be
291291
// true. Thus, in EWFS terms, we are effectively
292292
// creating a single child of the `A :- A` goal that
293293
// is like `A :- B, C, D` where B, C, and D are the
294294
// simplified subgoals. You can think of this as
295295
// applying built-in "meta program clauses" that
296-
// reduce HH goals into Domain goals.
296+
// reduce goals into Domain goals.
297297
if let Ok(ex_clause) =
298298
Self::simplify_goal(context, &mut infer, subst, environment, goal)
299299
{

chalk-engine/src/simplify.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use chalk_ir::interner::Interner;
77
use chalk_ir::{Environment, Goal, GoalData, InEnvironment, QuantifierKind, Substitution};
88

99
impl<I: Interner, C: Context<I>> Forest<I, C> {
10-
/// Simplifies an HH goal into a series of positive domain goals
11-
/// and negative HH goals. This operation may fail if the HH goal
10+
/// Simplifies a goal into a series of positive domain goals
11+
/// and negative goals. This operation may fail if the goal
1212
/// includes unifications that cannot be completed.
1313
pub(super) fn simplify_goal(
1414
context: &impl ContextOps<I, C>,
1515
infer: &mut dyn InferenceTable<I, C>,
1616
subst: Substitution<I>,
1717
initial_environment: Environment<I>,
18-
initial_hh_goal: Goal<I>,
18+
initial_goal: Goal<I>,
1919
) -> Fallible<ExClause<I>> {
2020
let mut ex_clause = ExClause {
2121
subst,
@@ -28,10 +28,10 @@ impl<I: Interner, C: Context<I>> Forest<I, C> {
2828
};
2929

3030
// A stack of higher-level goals to process.
31-
let mut pending_goals = vec![(initial_environment, initial_hh_goal)];
31+
let mut pending_goals = vec![(initial_environment, initial_goal)];
3232

33-
while let Some((environment, hh_goal)) = pending_goals.pop() {
34-
match hh_goal.data(context.interner()) {
33+
while let Some((environment, goal)) = pending_goals.pop() {
34+
match goal.data(context.interner()) {
3535
GoalData::Quantified(QuantifierKind::ForAll, subgoal) => {
3636
let subgoal =
3737
infer.instantiate_binders_universally(context.interner(), &subgoal);

chalk-solve/src/solve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ enum SolverImpl<I: Interner> {
275275
forest: Box<Forest<I, SlgContext<I>>>,
276276
max_size: usize,
277277
/// The expected number of answers for a solution.
278-
/// Only really sseful for tests, since `make_solution`
278+
/// Only really useful for tests, since `make_solution`
279279
/// will panic if the number of cached answers does not
280280
/// equal this when a solution is made.
281281
expected_answers: Option<usize>,

0 commit comments

Comments
 (0)