We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
to_bits
1 parent eceeb63 commit 50d3783Copy full SHA for 50d3783
src/librustc/mir/interpret/value.rs
@@ -218,7 +218,7 @@ impl<'tcx> Scalar {
218
219
pub fn to_bits(self, size: Size) -> EvalResult<'tcx, u128> {
220
match self {
221
- Scalar::Bits { defined: 0, .. } => err!(ReadUndefBytes),
+ Scalar::Bits { .. } if size.bits() == 0 => bug!("to_bits cannot be used with zsts"),
222
Scalar::Bits { bits, defined } if size.bits() <= defined as u64 => Ok(bits),
223
Scalar::Bits { .. } => err!(ReadUndefBytes),
224
Scalar::Ptr(_) => err!(ReadPointerAsBytes),
0 commit comments