about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-11-15 17:40:54 +0000
committerlcnr <rust@lcnr.de>2023-11-17 08:58:18 +0000
commit41cfb20abb1b33af6a1294cd09cdb1203249bd23 (patch)
tree4ac3c8a96e4b7662d44951e1fe3f322531441ef4 /compiler/rustc_const_eval/src/transform
parent00bfd6b2734d9c28a147bf237490995731781fdd (diff)
downloadrust-41cfb20abb1b33af6a1294cd09cdb1203249bd23.tar.gz
rust-41cfb20abb1b33af6a1294cd09cdb1203249bd23.zip
replace unnecessary folder impls with fold_region
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/promote_consts.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs
index 32af537e271..b3d6b891b11 100644
--- a/compiler/rustc_const_eval/src/transform/promote_consts.rs
+++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs
@@ -864,6 +864,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
             };
 
             // Use the underlying local for this (necessarily interior) borrow.
+            debug_assert!(region.is_erased());
             let ty = local_decls[place.local].ty;
             let span = statement.source_info.span;
 
@@ -873,8 +874,6 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
                 ty::TypeAndMut { ty, mutbl: borrow_kind.to_mutbl_lossy() },
             );
 
-            *region = tcx.lifetimes.re_erased;
-
             let mut projection = vec![PlaceElem::Deref];
             projection.extend(place.projection);
             place.projection = tcx.mk_place_elems(&projection);