Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3404820

Browse files
committed
Always turn codegen debug assertions off in Miri
1 parent 55529ec commit 3404820

File tree

1 file changed

+3
-6
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+3
-6
lines changed

compiler/rustc_const_eval/src/interpret/step.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
259259
Scalar::from_target_usize(val, self)
260260
}
261261
mir::NullOp::DebugAssertions => {
262-
// This should never actually lead us to any checks, because for the most
263-
// part those checks cannot be done in const-eval, and where they can be
264-
// done CTFE/Miri have better diagnostics.
265-
// But we implement the NullOp here to be correct I guess?
266-
let val = self.tcx.sess.opts.debug_assertions;
267-
Scalar::from_bool(val)
262+
// The checks hidden behind this are always better done by the interpreter
263+
// itself, because it knows the runtime state better.
264+
Scalar::from_bool(false)
268265
}
269266
};
270267
self.write_scalar(val, &dest)?;

0 commit comments

Comments
 (0)