@@ -474,27 +474,25 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
474
474
cg_base. project_index ( bx, llindex)
475
475
}
476
476
mir:: ProjectionElem :: ConstantIndex { offset, from_end : false , min_length : _ } => {
477
- let lloffset = bx. cx ( ) . const_usize ( offset as u64 ) ;
477
+ let lloffset = bx. cx ( ) . const_usize ( offset) ;
478
478
cg_base. project_index ( bx, lloffset)
479
479
}
480
480
mir:: ProjectionElem :: ConstantIndex { offset, from_end : true , min_length : _ } => {
481
- let lloffset = bx. cx ( ) . const_usize ( offset as u64 ) ;
481
+ let lloffset = bx. cx ( ) . const_usize ( offset) ;
482
482
let lllen = cg_base. len ( bx. cx ( ) ) ;
483
483
let llindex = bx. sub ( lllen, lloffset) ;
484
484
cg_base. project_index ( bx, llindex)
485
485
}
486
486
mir:: ProjectionElem :: Subslice { from, to, from_end } => {
487
- let mut subslice = cg_base. project_index ( bx, bx. cx ( ) . const_usize ( from as u64 ) ) ;
487
+ let mut subslice = cg_base. project_index ( bx, bx. cx ( ) . const_usize ( from) ) ;
488
488
let projected_ty =
489
489
PlaceTy :: from_ty ( cg_base. layout . ty ) . projection_ty ( tcx, * elem) . ty ;
490
490
subslice. layout = bx. cx ( ) . layout_of ( self . monomorphize ( projected_ty) ) ;
491
491
492
492
if subslice. layout . is_unsized ( ) {
493
493
assert ! ( from_end, "slice subslices should be `from_end`" ) ;
494
- subslice. llextra = Some ( bx. sub (
495
- cg_base. llextra . unwrap ( ) ,
496
- bx. cx ( ) . const_usize ( ( from as u64 ) + ( to as u64 ) ) ,
497
- ) ) ;
494
+ subslice. llextra =
495
+ Some ( bx. sub ( cg_base. llextra . unwrap ( ) , bx. cx ( ) . const_usize ( from + to) ) ) ;
498
496
}
499
497
500
498
subslice
0 commit comments