From 8759e5a8c68dec8b3aa67ddbdd24e1270700cd7e Mon Sep 17 00:00:00 2001 From: Camille Gillot Date: Sun, 14 Dec 2025 17:30:07 +0000 Subject: [PATCH] Update doc. --- compiler/rustc_mir_transform/src/promote_consts.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_mir_transform/src/promote_consts.rs b/compiler/rustc_mir_transform/src/promote_consts.rs index faff0f23143a..11266ccc2832 100644 --- a/compiler/rustc_mir_transform/src/promote_consts.rs +++ b/compiler/rustc_mir_transform/src/promote_consts.rs @@ -360,7 +360,8 @@ impl<'tcx> Validator<'_, 'tcx> { match operand { Operand::Copy(place) | Operand::Move(place) => self.validate_place(place.as_ref()), - // Promoting a runtime check would transform a runtime error into a compile-time error. + // `RuntimeChecks` behaves different in const-eval and runtime MIR, + // so we do not promote it. Operand::RuntimeChecks(_) => Err(Unpromotable), // The qualifs for a constant (e.g. `HasMutInterior`) are checked in