about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorchenyukang <moorekang@gmail.com>2022-08-30 10:03:02 +0800
committeryukang <moorekang@gmail.com>2022-09-09 09:51:21 +0800
commit7e7dfb83dc1fe63d1ce14101339f5eee5b76159d (patch)
tree23203ea78337715c40a9da918fd339bdf3ff060a /compiler
parent50e5d03e16790400f0c5b6ce6d3a27f6a71c5298 (diff)
downloadrust-7e7dfb83dc1fe63d1ce14101339f5eee5b76159d.tar.gz
rust-7e7dfb83dc1fe63d1ce14101339f5eee5b76159d.zip
fix #101097, avoid infinite loop in fn arguments checking
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs b/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs
index 90a2589d747..fc83994caf5 100644
--- a/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs
+++ b/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs
@@ -236,8 +236,8 @@ impl<'tcx> ArgMatrix<'tcx> {
                             if matches!(c, Compatibility::Compatible) { Some(i) } else { None }
                         })
                         .collect();
-                if compat.len() != 1 {
-                    // this could go into multiple slots, don't bother exploring both
+                if compat.len() < 1 {
+                    // try to find a cycle even when this could go into multiple slots, see #101097
                     is_cycle = false;
                     break;
                 }