bail if there are too many non-region infer vars
This commit is contained in:
parent
2b11f265b6
commit
5a219cba95
@ -157,6 +157,13 @@ pub(in crate::solve) fn evaluate_added_goals_and_make_canonical_response(
|
||||
},
|
||||
);
|
||||
|
||||
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
|
||||
if num_non_region_vars > self.cx().recursion_limit() {
|
||||
return Ok(self.make_ambiguous_response_no_constraints(MaybeCause::Overflow {
|
||||
suggest_increasing_limit: true,
|
||||
}));
|
||||
}
|
||||
|
||||
Ok(canonical)
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
//@ check-pass
|
||||
//@ revisions: current next
|
||||
//[next]@ compile-flags: -Znext-solver
|
||||
|
||||
// Regression test for nalgebra hang <https://github.com/rust-lang/rust/issues/130056>.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user