Ensure we don't accidentally turn non-zsts into zsts

This commit is contained in:
Oliver Scherer 2019-12-27 00:52:12 +01:00
parent 4fbe434c5c
commit 23b0c47024

View file

@ -125,6 +125,7 @@ pub(super) fn op_to_const<'tcx>(
}
Scalar::Raw { data, .. } => {
assert_eq!(data, mplace.layout.align.abi.bytes().into());
assert!(mplace.layout.is_zst());
ConstValue::Scalar(Scalar::zst())
}
};