@@ -925,6 +925,10 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
925
925
Ok ( ( ) )
926
926
}
927
927
928
+ /// This is called when there are no remaining subgoals for a strand, so
929
+ /// it represents an answer. If the strand is ambiguous and we don't want
930
+ /// it yet, we just enqueue it again to pick it up later. Otherwise, we
931
+ /// add the answer from the strand onto the table.
928
932
fn on_no_remaining_subgoals ( & mut self , strand : Strand < I , C > ) -> NoRemainingSubgoalsResult {
929
933
let ambiguous = strand. ex_clause . ambiguous ;
930
934
if let AnswerMode :: Complete = self . forest . tables [ self . stack . top ( ) . table ] . answer_mode {
@@ -950,8 +954,11 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
950
954
// answer for this table. Now, this table was either a
951
955
// subgoal for another strand, or was the root table.
952
956
let table = self . stack . top ( ) . table ;
953
- let mut caller_strand = match self . stack . pop_and_take_caller_strand ( ) {
954
- Some ( s) => s,
957
+ match self . stack . pop_and_take_caller_strand ( ) {
958
+ Some ( caller_strand) => {
959
+ self . stack . top ( ) . active_strand = Some ( caller_strand) ;
960
+ return NoRemainingSubgoalsResult :: Success ;
961
+ }
955
962
None => {
956
963
// That was the root table, so we are done --
957
964
// *well*, unless there were delayed
@@ -972,22 +979,13 @@ impl<'forest, I: Interner, C: Context<I> + 'forest, CO: ContextOps<I, C> + 'fore
972
979
return NoRemainingSubgoalsResult :: RootAnswerAvailable ;
973
980
}
974
981
} ;
975
-
976
- match self . merge_answer_into_strand ( & mut caller_strand) {
977
- Err ( e) => {
978
- drop ( caller_strand) ;
979
- return NoRemainingSubgoalsResult :: RootSearchFail ( e) ;
980
- }
981
- Ok ( _) => {
982
- self . stack . top ( ) . active_strand = Some ( caller_strand) ;
983
- return NoRemainingSubgoalsResult :: Success ;
984
- }
985
- }
986
982
}
987
983
None => {
988
984
debug ! ( "answer is not available (or not new)" ) ;
989
985
990
- // This table ned nowhere of interest
986
+ // This strand led nowhere of interest. There might be *other*
987
+ // answers on this table, but we don't care right now, we'll
988
+ // try again at another time.
991
989
992
990
// Now we yield with `QuantumExceeded`
993
991
self . unwind_stack ( ) ;
0 commit comments