mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
bail if there are too many non-region infer vars
This commit is contained in:
parent
2b11f265b6
commit
5a219cba95
@ -157,6 +157,13 @@ where
|
||||
},
|
||||
);
|
||||
|
||||
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