We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31839d3 commit ee4bed1Copy full SHA for ee4bed1
src/base.rs
@@ -690,10 +690,11 @@ pub fn trans_place<'tcx>(
690
ty::Slice(elem_ty) => {
691
assert!(from_end, "slice subslices should be `from_end`");
692
let elem_layout = fx.layout_of(elem_ty);
693
- let (ptr, _len) = cplace.to_ptr_maybe_unsized(fx);
+ let (ptr, len) = cplace.to_ptr_maybe_unsized(fx);
694
+ let len = len.unwrap();
695
cplace = CPlace::for_ptr_with_extra(
696
ptr.offset_i64(fx, elem_layout.size.bytes() as i64 * from as i64),
- fx.bcx.ins().iconst(pointer_ty(fx.tcx), (to as u64 - from as u64) as i64),
697
+ fx.bcx.ins().iadd_imm(len, -(from as i64 + to as i64)),
698
cplace.layout(),
699
);
700
}
0 commit comments