Only enable library UB checks in const-eval/Miri when debug_assertions are enabled
Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
parent
50d0bea153
commit
27cf4bb985
@ -264,7 +264,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
// But we want to disable checks for language UB, because the interpreter
|
||||
// has its own better checks for that.
|
||||
let should_check = match kind {
|
||||
mir::UbKind::LibraryUb => true,
|
||||
mir::UbKind::LibraryUb => self.tcx.sess.opts.debug_assertions,
|
||||
mir::UbKind::LanguageUb => false,
|
||||
};
|
||||
Scalar::from_bool(should_check)
|
||||
|
Loading…
x
Reference in New Issue
Block a user