Skip to content

Commit cbbad2d

Browse files
committed
Fix length computation.
1 parent 0f481cc commit cbbad2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/mir/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl ConstValue {
171171
// Non-empty slice, must have memory. We know this is a relative pointer.
172172
let (inner_prov, offset) =
173173
ptr.into_pointer_or_addr().ok()?.prov_and_relative_offset();
174-
(inner_prov.alloc_id(), offset.bytes(), offset.bytes() + len)
174+
(inner_prov.alloc_id(), offset.bytes(), len)
175175
}
176176
};
177177

0 commit comments

Comments
 (0)