@@ -102,27 +102,6 @@ impl<C: Context> Forest<C> {
102
102
ambiguous : answer. ambiguous ,
103
103
} )
104
104
}
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
- }
126
105
Err ( err) => Err ( err) ,
127
106
}
128
107
}
@@ -1322,6 +1301,8 @@ impl<'forest, C: Context + 'forest, CO: ContextOps<C> + 'forest> SolveState<'for
1322
1301
}
1323
1302
}
1324
1303
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
1325
1306
fn pursue_answer_from_floundered ( & mut self , strand : Strand < C > ) -> Option < AnswerIndex > {
1326
1307
let table = self . stack . top ( ) . table ;
1327
1308
let Strand {
@@ -1355,6 +1336,9 @@ impl<'forest, C: Context + 'forest, CO: ContextOps<C> + 'forest> SolveState<'for
1355
1336
subst,
1356
1337
ambiguous : true ,
1357
1338
} ;
1339
+
1340
+ // If our answer gives trivial information on the canonicalized goal then we have nothing interesting
1341
+ // to return.
1358
1342
let is_trivial_answer = self
1359
1343
. context
1360
1344
. is_trivial_substitution ( & self . forest . tables [ table] . table_goal , & answer. subst ) ;
0 commit comments