Rollup merge of #98968 - RalfJung:scalar-sanity, r=oli-obk
assert Scalar sanity With https://github.com/rust-lang/rust/pull/96814 having landed, finally our `Scalar` layouts have the invariants they deserve. :)
This commit is contained in:
commit
7f62a719af
4 changed files with 20 additions and 7 deletions
|
@ -306,9 +306,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
s.is_ptr() || (number_may_have_provenance && size == self.pointer_size())
|
||||
};
|
||||
if let Some(s) = scalar_layout {
|
||||
//FIXME(#96185): let size = s.size(self);
|
||||
//FIXME(#96185): assert_eq!(size, mplace.layout.size, "abi::Scalar size does not match layout size");
|
||||
let size = mplace.layout.size; //FIXME(#96185): remove this line
|
||||
let size = s.size(self);
|
||||
assert_eq!(size, mplace.layout.size, "abi::Scalar size does not match layout size");
|
||||
let scalar =
|
||||
alloc.read_scalar(alloc_range(Size::ZERO, size), read_provenance(s, size))?;
|
||||
return Ok(Some(ImmTy { imm: scalar.into(), layout: mplace.layout }));
|
||||
|
|
|
@ -793,7 +793,7 @@ where
|
|||
)
|
||||
};
|
||||
let size = s.size(&tcx);
|
||||
//FIXME(#96185): assert_eq!(dest.layout.size, size, "abi::Scalar size does not match layout size");
|
||||
assert_eq!(size, dest.layout.size, "abi::Scalar size does not match layout size");
|
||||
alloc.write_scalar(alloc_range(Size::ZERO, size), scalar)
|
||||
}
|
||||
Immediate::ScalarPair(a_val, b_val) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue