From 0850bad94dab9499a6dde0f303a73220a21a2f71 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 4 Jul 2022 09:12:22 -0400 Subject: [PATCH] extra assertion, extra sure --- compiler/rustc_const_eval/src/interpret/operator.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_const_eval/src/interpret/operator.rs b/compiler/rustc_const_eval/src/interpret/operator.rs index 5d044a7fcd169..dec7fa8c4aa96 100644 --- a/compiler/rustc_const_eval/src/interpret/operator.rs +++ b/compiler/rustc_const_eval/src/interpret/operator.rs @@ -32,6 +32,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let pair = Immediate::ScalarPair(val.into(), Scalar::from_bool(overflowed).into()); self.write_immediate(pair, dest)?; } else { + assert!(self.tcx.sess.opts.debugging_opts.randomize_layout); // With randomized layout, `(int, bool)` might cease to be a `ScalarPair`, so we have to // do a component-wise write here. This code path is slower than the above because // `place_field` will have to `force_allocate` locals here.