From 0f6d36375f76f31a5252b8b8ab5faaafb374e721 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 21 Feb 2019 13:15:59 +0100 Subject: [PATCH] explain why we use static alignment in ref-to-place conversion --- src/librustc_mir/interpret/place.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index b29e09900f6b..637f1dcc4a4d 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -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()?, };