Skip to content

Commit 5a8f6db

Browse files
committed
update comments
1 parent 1a7ce02 commit 5a8f6db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_mir/interpret/operand.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,15 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
529529
let op = match val.val {
530530
ConstValue::ByRef(ptr, _alloc) => {
531531
// We rely on mutability being set correctly in that allocation to prevent writes
532-
// where none should happen -- and for `static mut`, we copy on demand anyway.
532+
// where none should happen.
533533
let ptr = self.tag_static_base_pointer(ptr);
534534
Operand::Indirect(MemPlace::from_ptr(ptr, layout.align.abi))
535535
},
536536
ConstValue::Scalar(x) =>
537537
Operand::Immediate(Immediate::Scalar(tag_scalar(x).into())),
538538
ConstValue::Slice { data, start, end } => {
539+
// We rely on mutability being set correctly in `data` to prevent writes
540+
// where none should happen.
539541
let ptr = Pointer::new(
540542
self.tcx.alloc_map.lock().allocate(data),
541543
Size::from_bytes(start as u64), // offset: `start`

0 commit comments

Comments
 (0)