]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/interpret/operand.rs
update comments
[rust.git] / src / librustc_mir / interpret / operand.rs
index 2fc7d65d655df2a17fc781b6f8fc43532111995e..899cc40dc32065f3f4078657e9138bf1ab8a43fe 100644 (file)
@@ -529,13 +529,15 @@ pub(super) fn eval_operands(
         let op = match val.val {
             ConstValue::ByRef(ptr, _alloc) => {
                 // We rely on mutability being set correctly in that allocation to prevent writes
-                // where none should happen -- and for `static mut`, we copy on demand anyway.
+                // where none should happen.
                 let ptr = self.tag_static_base_pointer(ptr);
                 Operand::Indirect(MemPlace::from_ptr(ptr, layout.align.abi))
             },
             ConstValue::Scalar(x) =>
                 Operand::Immediate(Immediate::Scalar(tag_scalar(x).into())),
             ConstValue::Slice { data, start, end } => {
+                // We rely on mutability being set correctly in `data` to prevent writes
+                // where none should happen.
                 let ptr = Pointer::new(
                     self.tcx.alloc_map.lock().create_memory_alloc(data),
                     Size::from_bytes(start as u64), // offset: `start`