about summary refs log tree commit diff
path: root/src/librustc_mir
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-02-21 13:15:59 +0100
committerRalf Jung <post@ralfj.de>2019-02-21 13:15:59 +0100
commit0f6d36375f76f31a5252b8b8ab5faaafb374e721 (patch)
treefcd71e79963dae518dd3c8c9893a9a5c0d1392e3 /src/librustc_mir
parent1349c84a4fa0fca9b866b2e859d28ee185ca0c1b (diff)
downloadrust-0f6d36375f76f31a5252b8b8ab5faaafb374e721.tar.gz
rust-0f6d36375f76f31a5252b8b8ab5faaafb374e721.zip
explain why we use static alignment in ref-to-place conversion
Diffstat (limited to 'src/librustc_mir')
-rw-r--r--src/librustc_mir/interpret/place.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs
index b29e09900f6..637f1dcc4a4 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()?,
         };