We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a219cb commit 9613f48Copy full SHA for 9613f48
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs
@@ -157,6 +157,10 @@ where
157
},
158
);
159
160
+ // HACK: We bail with overflow if the response would have too many non-region
161
+ // inference variables. This tends to only happen if we encounter a lot of
162
+ // ambiguous alias types which get replaced with fresh inference variables
163
+ // during generalization. This prevents a hang in nalgebra.
164
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
165
if num_non_region_vars > self.cx().recursion_limit() {
166
return Ok(self.make_ambiguous_response_no_constraints(MaybeCause::Overflow {
0 commit comments