Skip to content

Commit c8135bb

Browse files
committed
remove unnecessary change
1 parent a856dda commit c8135bb

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

chalk-engine/src/logic.rs

+5-21
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,6 @@ impl<C: Context> Forest<C> {
102102
ambiguous: answer.ambiguous,
103103
})
104104
}
105-
Err(RootSearchFail::Floundered) => {
106-
if state.stack.is_empty() {
107-
if let Some(answer) = state.forest.tables[table].answer(answer_index) {
108-
debug!("floundered but still has answer {:?}", answer);
109-
let has_delayed_subgoals = C::has_delayed_subgoals(&answer.subst);
110-
if has_delayed_subgoals {
111-
return Err(RootSearchFail::InvalidAnswer);
112-
}
113-
Ok(CompleteAnswer {
114-
subst: C::canonical_constrained_subst_from_canonical_constrained_answer(
115-
&answer.subst,
116-
),
117-
ambiguous: answer.ambiguous,
118-
})
119-
} else {
120-
Err(RootSearchFail::Floundered)
121-
}
122-
} else {
123-
Err(RootSearchFail::Floundered)
124-
}
125-
}
126105
Err(err) => Err(err),
127106
}
128107
}
@@ -1322,6 +1301,8 @@ impl<'forest, C: Context + 'forest, CO: ContextOps<C> + 'forest> SolveState<'for
13221301
}
13231302
}
13241303

1304+
/// This strand has no subgoals left, but some have floundered.
1305+
/// It's still possible that we can get an ambiguous answer from it though
13251306
fn pursue_answer_from_floundered(&mut self, strand: Strand<C>) -> Option<AnswerIndex> {
13261307
let table = self.stack.top().table;
13271308
let Strand {
@@ -1355,6 +1336,9 @@ impl<'forest, C: Context + 'forest, CO: ContextOps<C> + 'forest> SolveState<'for
13551336
subst,
13561337
ambiguous: true,
13571338
};
1339+
1340+
// If our answer gives trivial information on the canonicalized goal then we have nothing interesting
1341+
// to return.
13581342
let is_trivial_answer = self
13591343
.context
13601344
.is_trivial_substitution(&self.forest.tables[table].table_goal, &answer.subst);

0 commit comments

Comments
 (0)