about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/traits/structural_impls.rs
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2024-02-23 10:12:08 +0100
committerlcnr <rust@lcnr.de>2024-02-29 10:14:02 +0100
commit5ec9b8d778b91cb579dc177eedaff4ba69bba33f (patch)
treea01108aebbd3706569d548c9166b93be4874b727 /compiler/rustc_infer/src/traits/structural_impls.rs
parentd3d145ea1cae47ad392173f890577788117da3d9 (diff)
downloadrust-5ec9b8d778b91cb579dc177eedaff4ba69bba33f.tar.gz
rust-5ec9b8d778b91cb579dc177eedaff4ba69bba33f.zip
distinguish recursion limit based overflow for diagnostics
also change the number of allowed fixpoint steps to be fixed instead
of using the `log` of the total recursion depth.
Diffstat (limited to 'compiler/rustc_infer/src/traits/structural_impls.rs')
-rw-r--r--compiler/rustc_infer/src/traits/structural_impls.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/traits/structural_impls.rs b/compiler/rustc_infer/src/traits/structural_impls.rs
index 3b4050fcd27..bf4f88530d0 100644
--- a/compiler/rustc_infer/src/traits/structural_impls.rs
+++ b/compiler/rustc_infer/src/traits/structural_impls.rs
@@ -47,8 +47,10 @@ impl<'tcx> fmt::Debug for traits::FulfillmentErrorCode<'tcx> {
             ConstEquateError(ref a, ref b) => {
                 write!(f, "CodeConstEquateError({a:?}, {b:?})")
             }
-            Ambiguity { overflow: false } => write!(f, "Ambiguity"),
-            Ambiguity { overflow: true } => write!(f, "Overflow"),
+            Ambiguity { overflow: None } => write!(f, "Ambiguity"),
+            Ambiguity { overflow: Some(suggest_increasing_limit) } => {
+                write!(f, "Overflow({suggest_increasing_limit})")
+            }
             Cycle(ref cycle) => write!(f, "Cycle({cycle:?})"),
         }
     }