1
Fork 0

distinguish recursion limit based overflow for diagnostics

also change the number of allowed fixpoint steps to be fixed instead
of using the `log` of the total recursion depth.
This commit is contained in:
lcnr 2024-02-23 10:12:08 +01:00
parent d3d145ea1c
commit 5ec9b8d778
25 changed files with 91 additions and 125 deletions

View file

@ -80,11 +80,14 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
.0
{
Ok((_, Certainty::Maybe(MaybeCause::Ambiguity))) => {
FulfillmentErrorCode::Ambiguity { overflow: false }
}
Ok((_, Certainty::Maybe(MaybeCause::Overflow))) => {
FulfillmentErrorCode::Ambiguity { overflow: true }
FulfillmentErrorCode::Ambiguity { overflow: None }
}
Ok((
_,
Certainty::Maybe(MaybeCause::Overflow { suggest_increasing_limit }),
)) => FulfillmentErrorCode::Ambiguity {
overflow: Some(suggest_increasing_limit),
},
Ok((_, Certainty::Yes)) => {
bug!("did not expect successful goal when collecting ambiguity errors")
}