Skip to content

Commit 27f9ef7

Browse files
committed
Rebase fixes
1 parent 9374586 commit 27f9ef7

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

chalk-ir/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl DebruijnIndex {
547547
/// known. It is referenced within the type using `^1`, indicating
548548
/// a bound type with debruijn index 1 (i.e., skipping through one
549549
/// level of binder).
550-
#[derive(Clone, PartialEq, Eq, Hash, Fold, Visit)]
550+
#[derive(Clone, PartialEq, Eq, Hash, Fold, Visit, HasInterner)]
551551
pub struct DynTy<I: Interner> {
552552
pub bounds: Binders<QuantifiedWhereClauses<I>>,
553553
}

chalk-ir/src/visit/boring_impls.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! The more interesting impls of `Visit` remain in the `visit` module.
66
77
use crate::{
8-
AssocTypeId, DebruijnIndex, Goals, ImplId, Interner, Parameter, ParameterKind,
8+
AssocTypeId, ClausePriority, DebruijnIndex, Goals, ImplId, Interner, Parameter, ParameterKind,
99
PlaceholderIndex, ProgramClause, ProgramClauseData, ProgramClauses, QuantifiedWhereClauses,
1010
QuantifierKind, StructId, Substitution, SuperVisit, TraitId, UniverseIndex, Visit, VisitResult,
1111
Visitor,
@@ -205,6 +205,7 @@ const_visit!(QuantifierKind);
205205
const_visit!(DebruijnIndex);
206206
const_visit!(chalk_engine::TableIndex);
207207
const_visit!(chalk_engine::TimeStamp);
208+
const_visit!(ClausePriority);
208209
const_visit!(());
209210

210211
#[macro_export]

chalk-solve/src/clauses.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ fn program_clauses_for_env<'db, I: Interner>(
415415
environment: &Environment<I>,
416416
clauses: &mut Vec<ProgramClause<I>>,
417417
) {
418-
clauses.extend(environment.clauses.iter().cloned());
418+
clauses.extend(environment.clauses.iter(db.interner()).cloned());
419419

420420
let mut last_round = FxHashSet::default();
421421
elaborate_env_clauses(

chalk-solve/src/recursive/fulfill.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ impl<'s, 'db, I: Interner> Fulfill<'s, 'db, I> {
183183
self.push_goal(environment, subgoal)?;
184184
}
185185
GoalData::Implies(wc, subgoal) => {
186-
let new_environment = &environment.add_clauses(wc.iter().cloned());
186+
let new_environment =
187+
&environment.add_clauses(interner, wc.iter(interner).cloned());
187188
self.push_goal(new_environment, subgoal.clone())?;
188189
}
189190
GoalData::All(goals) => {
@@ -293,7 +294,7 @@ impl<'s, 'db, I: Interner> Fulfill<'s, 'db, I> {
293294
// We use the empty environment for unification here because we're
294295
// really just doing a substitution on unconstrained variables, which is
295296
// guaranteed to succeed without generating any new constraints.
296-
let empty_env = &Environment::new();
297+
let empty_env = &Environment::new(self.solver.program.interner());
297298

298299
for (i, free_var) in free_vars.into_iter().enumerate() {
299300
let subst_value = subst.at(self.interner(), i);

chalk-solve/src/recursive/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,13 @@ impl<'me, I: Interner> Solver<'me, I> {
395395
for program_clause in clauses {
396396
debug_heading!("clause={:?}", program_clause);
397397

398-
match program_clause {
399-
ProgramClause::Implies(implication) => {
398+
match program_clause.data(self.program.interner()) {
399+
ProgramClauseData::Implies(implication) => {
400400
let res = self.solve_via_implication(
401401
canonical_goal,
402-
Binders {
402+
&Binders {
403403
binders: vec![],
404-
value: implication,
404+
value: implication.clone(),
405405
},
406406
minimums,
407407
);
@@ -436,7 +436,7 @@ impl<'me, I: Interner> Solver<'me, I> {
436436
debug!("error");
437437
}
438438
}
439-
ProgramClause::ForAll(implication) => {
439+
ProgramClauseData::ForAll(implication) => {
440440
let res = self.solve_via_implication(canonical_goal, implication, minimums);
441441
if let (Ok(solution), priority) = res {
442442
debug!("ok: solution={:?} prio={:?}", solution, priority);
@@ -480,7 +480,7 @@ impl<'me, I: Interner> Solver<'me, I> {
480480
fn solve_via_implication(
481481
&mut self,
482482
canonical_goal: &UCanonical<InEnvironment<DomainGoal<I>>>,
483-
clause: Binders<ProgramClauseImplication<I>>,
483+
clause: &Binders<ProgramClauseImplication<I>>,
484484
minimums: &mut Minimums,
485485
) -> (Fallible<Solution<I>>, ClausePriority) {
486486
info_heading!(
@@ -496,7 +496,7 @@ impl<'me, I: Interner> Solver<'me, I> {
496496
consequence,
497497
conditions,
498498
priority: _,
499-
} = fulfill.instantiate_binders_existentially(&clause);
499+
} = fulfill.instantiate_binders_existentially(clause);
500500

501501
debug!("the subst is {:?}", subst);
502502

chalk-solve/src/solve/slg/resolvent.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ impl<I: Interner> context::ResolventOps<SlgContext<I>> for TruncatingInferenceTa
8585
conditions,
8686
priority: _,
8787
} = match clause.data(interner) {
88-
ProgramClause::Implies(implication) => implication.clone(),
89-
ProgramClause::ForAll(implication) => self
88+
ProgramClauseData::Implies(implication) => implication.clone(),
89+
ProgramClauseData::ForAll(implication) => self
9090
.infer
9191
.instantiate_binders_existentially(interner, implication),
9292
};

0 commit comments

Comments
 (0)