diff options
| author | Ben Kimock <kimockb@gmail.com> | 2024-04-03 08:54:03 -0400 | 
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2024-04-06 11:21:47 -0400 | 
| commit | a7912cb421db4f4039048cdba2b7fc98ae295342 (patch) | |
| tree | b221c94d64c7fd610f3937d2973fb503ef3d242e /compiler/rustc_mir_transform/src/instsimplify.rs | |
| parent | 83d0a940c65e9c276308c81107b9b21cf399cbc6 (diff) | |
| download | rust-a7912cb421db4f4039048cdba2b7fc98ae295342.tar.gz rust-a7912cb421db4f4039048cdba2b7fc98ae295342.zip | |
Put checks that detect UB under their own flag below debug_assertions
Diffstat (limited to 'compiler/rustc_mir_transform/src/instsimplify.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/instsimplify.rs | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/compiler/rustc_mir_transform/src/instsimplify.rs b/compiler/rustc_mir_transform/src/instsimplify.rs index 1b38eeccfad..ff786d44d6a 100644 --- a/compiler/rustc_mir_transform/src/instsimplify.rs +++ b/compiler/rustc_mir_transform/src/instsimplify.rs @@ -149,7 +149,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> { fn simplify_ub_check(&self, source_info: &SourceInfo, rvalue: &mut Rvalue<'tcx>) { if let Rvalue::NullaryOp(NullOp::UbChecks, _) = *rvalue { - let const_ = Const::from_bool(self.tcx, self.tcx.sess.opts.debug_assertions); + let const_ = Const::from_bool(self.tcx, self.tcx.sess.ub_checks()); let constant = ConstOperand { span: source_info.span, const_, user_ty: None }; *rvalue = Rvalue::Use(Operand::Constant(Box::new(constant))); } | 
