We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a601e76 commit 8759e5aCopy full SHA for 8759e5a
compiler/rustc_mir_transform/src/promote_consts.rs
@@ -360,7 +360,8 @@ impl<'tcx> Validator<'_, 'tcx> {
360
match operand {
361
Operand::Copy(place) | Operand::Move(place) => self.validate_place(place.as_ref()),
362
363
- // Promoting a runtime check would transform a runtime error into a compile-time error.
+ // `RuntimeChecks` behaves different in const-eval and runtime MIR,
364
+ // so we do not promote it.
365
Operand::RuntimeChecks(_) => Err(Unpromotable),
366
367
// The qualifs for a constant (e.g. `HasMutInterior`) are checked in
0 commit comments