Skip to content

Commit 0f6d363

Browse files
committed
explain why we use static alignment in ref-to-place conversion
1 parent 1349c84 commit 0f6d363

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/place.rs

+4
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ where
326326

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

0 commit comments

Comments
 (0)