Skip to content

Commit 27cf4bb

Browse files
saethlinRalfJung
andauthored
Only enable library UB checks in const-eval/Miri when debug_assertions are enabled
Co-authored-by: Ralf Jung <[email protected]>
1 parent 50d0bea commit 27cf4bb

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/step.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
264264
// But we want to disable checks for language UB, because the interpreter
265265
// has its own better checks for that.
266266
let should_check = match kind {
267-
mir::UbKind::LibraryUb => true,
267+
mir::UbKind::LibraryUb => self.tcx.sess.opts.debug_assertions,
268268
mir::UbKind::LanguageUb => false,
269269
};
270270
Scalar::from_bool(should_check)

0 commit comments

Comments
 (0)