diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index cd7a472c0f0..d69192ef6ed 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -785,15 +785,7 @@ fn visit_value(&mut self, op: &OpTy<'tcx, M::Provenance>) -> InterpResult<'tcx> } } Abi::ScalarPair(a_layout, b_layout) => { - // There is no `rustc_layout_scalar_valid_range_start` for pairs, so - // we would validate these things as we descend into the fields, - // but that can miss bugs in layout computation. Layout computation - // is subtle due to enums having ScalarPair layout, where one field - // is the discriminant. - if cfg!(debug_assertions) - && !a_layout.is_uninit_valid() - && !b_layout.is_uninit_valid() - { + if !a_layout.is_uninit_valid() && !b_layout.is_uninit_valid() { // We can only proceed if *both* scalars need to be initialized. // FIXME: find a way to also check ScalarPair when one side can be uninit but // the other must be init.