]> git.lizzy.rs Git - rust.git/commitdiff
explain why we use static alignment in ref-to-place conversion
authorRalf Jung <post@ralfj.de>
Thu, 21 Feb 2019 12:15:59 +0000 (13:15 +0100)
committerRalf Jung <post@ralfj.de>
Thu, 21 Feb 2019 12:15:59 +0000 (13:15 +0100)
src/librustc_mir/interpret/place.rs

index b29e09900f6b1e2e1dc0b67eeda4ce7bb8c46837..637f1dcc4a4da78ee991d5bb88f19363de3f83a5 100644 (file)
@@ -326,6 +326,10 @@ pub fn ref_to_mplace(
 
         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()?,
         };