add comment
This commit is contained in:
parent
5a219cba95
commit
9613f487ae
1 changed files with 4 additions and 0 deletions
|
@ -157,6 +157,10 @@ where
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// HACK: We bail with overflow if the response would have too many non-region
|
||||||
|
// inference variables. This tends to only happen if we encounter a lot of
|
||||||
|
// ambiguous alias types which get replaced with fresh inference variables
|
||||||
|
// during generalization. This prevents a hang in nalgebra.
|
||||||
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
|
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
|
||||||
if num_non_region_vars > self.cx().recursion_limit() {
|
if num_non_region_vars > self.cx().recursion_limit() {
|
||||||
return Ok(self.make_ambiguous_response_no_constraints(MaybeCause::Overflow {
|
return Ok(self.make_ambiguous_response_no_constraints(MaybeCause::Overflow {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue