From 7bffe945af456df6ad3294bdf82a67d727880adc Mon Sep 17 00:00:00 2001 From: yukang Date: Tue, 21 Mar 2023 20:05:34 +0800 Subject: [PATCH] add delay_span_bug --- compiler/rustc_hir_typeck/src/upvar.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_hir_typeck/src/upvar.rs b/compiler/rustc_hir_typeck/src/upvar.rs index 90947912a19d..4847bddc38d1 100644 --- a/compiler/rustc_hir_typeck/src/upvar.rs +++ b/compiler/rustc_hir_typeck/src/upvar.rs @@ -712,7 +712,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - // return Equal for two identical projections + self.tcx.sess.delay_span_bug( + closure_span, + &format!( + "two identical projections: ({:?}, {:?})", + capture1.place.projections, capture2.place.projections + ), + ); std::cmp::Ordering::Equal }); }