diff options
| author | Ralf Jung <post@ralfj.de> | 2019-05-29 15:16:18 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-06-02 10:36:18 +0200 |
| commit | 823ffaa834bde2fb0daabd010c369aae561fb765 (patch) | |
| tree | 243413ecb01e4452c1ac0663062a79328db20ee5 /src | |
| parent | 2ba7e776b611b797b00e5a2cd02584c5993514d5 (diff) | |
| download | rust-823ffaa834bde2fb0daabd010c369aae561fb765.tar.gz rust-823ffaa834bde2fb0daabd010c369aae561fb765.zip | |
update comments
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/interpret/operand.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 2fc7d65d655..899cc40dc32 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -529,13 +529,15 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> 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` |
