We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b11f26 commit 5a219cbCopy full SHA for 5a219cb
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs
@@ -157,6 +157,13 @@ where
157
},
158
);
159
160
+ let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
161
+ if num_non_region_vars > self.cx().recursion_limit() {
162
+ return Ok(self.make_ambiguous_response_no_constraints(MaybeCause::Overflow {
163
+ suggest_increasing_limit: true,
164
+ }));
165
+ }
166
+
167
Ok(canonical)
168
}
169
tests/ui/traits/coherence-alias-hang.rs
@@ -1,4 +1,6 @@
1
//@ check-pass
2
+//@ revisions: current next
3
+//[next]@ compile-flags: -Znext-solver
4
5
// Regression test for nalgebra hang <https://github.com/rust-lang/rust/issues/130056>.
6
0 commit comments