about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGavin Gray <gavinleroy6@gmail.com>2023-11-13 16:36:01 +0100
committerGavin Gray <gavinleroy6@gmail.com>2023-11-13 16:36:01 +0100
commit60d99ab8837e973c0df5fe518a2ed136c8ac0f20 (patch)
tree6e531d4e065b5a950a26570001d1848a3426d767
parent1ab2bcda4303b81b1124b88ddff6f5e9a68d7bc2 (diff)
downloadrust-60d99ab8837e973c0df5fe518a2ed136c8ac0f20.tar.gz
rust-60d99ab8837e973c0df5fe518a2ed136c8ac0f20.zip
Fix overflow and cycle bound for ProofTreeVisitor.
-rw-r--r--compiler/rustc_trait_selection/src/solve/inspect/analyse.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs b/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs
index 69bfdd4688c..951080ac61a 100644
--- a/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs
+++ b/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs
@@ -58,7 +58,7 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> {
         visitor: &mut V,
     ) -> ControlFlow<V::BreakTy> {
         // HACK: An arbitrary cutoff to avoid dealing with overflow and cycles.
-        if self.goal.depth >= 10 {
+        if self.goal.depth <= 10 {
             let infcx = self.goal.infcx;
             infcx.probe(|_| {
                 let mut instantiated_goals = vec![];