mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 18:08:53 +03:00
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:
@@ -264,7 +264,7 @@ pub fn eval_rvalue_into_place(
|
||||
// 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)
|
||||
|
||||
Reference in New Issue
Block a user