about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-24 07:13:04 +0100
committerGitHub <noreply@github.com>2023-03-24 07:13:04 +0100
commit98254c5cc7828370eeec18e2646d70846a826b5a (patch)
tree3dda71277fea5895e92901be76f4ec3813ebc287 /compiler
parent936377a0aabd4e383e619aaff51a01cdffc154d0 (diff)
parent7bffe945af456df6ad3294bdf82a67d727880adc (diff)
Rollup merge of #109433 - chenyukang:yukang/fix-109188-ice, r=lcnr
Return equal for two identical projections

Fixes #109188
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_typeck/src/upvar.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_hir_typeck/src/upvar.rs b/compiler/rustc_hir_typeck/src/upvar.rs
index d5d260d7138..eadc30a799b 100644
--- a/compiler/rustc_hir_typeck/src/upvar.rs
+++ b/compiler/rustc_hir_typeck/src/upvar.rs
@@ -712,10 +712,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     }
                 }
 
-                unreachable!(
-                    "we captured two identical projections: capture1 = {:?}, capture2 = {:?}",
-                    capture1, capture2
+                self.tcx.sess.delay_span_bug(
+                    closure_span,
+                    &format!(
+                        "two identical projections: ({:?}, {:?})",
+                        capture1.place.projections, capture2.place.projections
+                    ),
                 );
+                std::cmp::Ordering::Equal
             });
         }