about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2025-09-24 13:02:27 +0200
committerlcnr <rust@lcnr.de>2025-09-24 13:08:25 +0200
commit32d24f9efa81a1c467da21c3ae2d93a6b00a9f5b (patch)
tree4eef2bb9fda0ccb66ca09faf08445847eedd90fd /compiler
parentae12bc21d8ec76bbb753d4da168e9b08e1b09ebf (diff)
downloadrust-32d24f9efa81a1c467da21c3ae2d93a6b00a9f5b.tar.gz
rust-32d24f9efa81a1c467da21c3ae2d93a6b00a9f5b.zip
allow bound regions in writeback
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_typeck/src/writeback.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_hir_typeck/src/writeback.rs b/compiler/rustc_hir_typeck/src/writeback.rs
index 6192420898f..d01eeb9a4b6 100644
--- a/compiler/rustc_hir_typeck/src/writeback.rs
+++ b/compiler/rustc_hir_typeck/src/writeback.rs
@@ -1003,8 +1003,10 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Resolver<'cx, 'tcx> {
     }
 
     fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
-        debug_assert!(!r.is_bound(), "Should not be resolving bound region.");
-        self.fcx.tcx.lifetimes.re_erased
+        match r.kind() {
+            ty::ReBound(..) => r,
+            _ => self.fcx.tcx.lifetimes.re_erased,
+        }
     }
 
     fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {