diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs index 62536c45eb312..9e3d4e60603ec 100644 --- a/src/librustc/mir/interpret/value.rs +++ b/src/librustc/mir/interpret/value.rs @@ -218,7 +218,7 @@ impl<'tcx> Scalar { pub fn to_bits(self, size: Size) -> EvalResult<'tcx, u128> { match self { - Scalar::Bits { defined: 0, .. } => err!(ReadUndefBytes), + Scalar::Bits { .. } if size.bits() == 0 => bug!("to_bits cannot be used with zsts"), Scalar::Bits { bits, defined } if size.bits() <= defined as u64 => Ok(bits), Scalar::Bits { .. } => err!(ReadUndefBytes), Scalar::Ptr(_) => err!(ReadPointerAsBytes),