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_const_eval/src/interpret | |
| 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_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/step.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs index 9114ffff6fd..db6c2833b9d 100644 --- a/compiler/rustc_const_eval/src/interpret/step.rs +++ b/compiler/rustc_const_eval/src/interpret/step.rs @@ -258,7 +258,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let val = layout.offset_of_subfield(self, fields.iter()).bytes(); Scalar::from_target_usize(val, self) } - mir::NullOp::UbChecks => Scalar::from_bool(self.tcx.sess.opts.debug_assertions), + mir::NullOp::UbChecks => Scalar::from_bool(self.tcx.sess.ub_checks()), }; self.write_scalar(val, &dest)?; } |
