explain why we use static alignment in ref-to-place conversion

This commit is contained in:
Ralf Jung 2019-02-21 13:15:59 +01:00
parent 1349c84a4f
commit 0f6d36375f

View file

@ -326,6 +326,10 @@ where
let mplace = MemPlace {
ptr: val.to_scalar_ptr()?,
// We could use the run-time alignment here. For now, we do not, because
// the point of tracking the alignment here is to make sure that the *static*
// alignment information emitted with the loads is correct. The run-time
// alignment can only be more restrictive.
align: layout.align.abi,
meta: val.to_meta()?,
};