@@ -474,27 +474,25 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
474474 cg_base. project_index ( bx, llindex)
475475 }
476476 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) ;
478478 cg_base. project_index ( bx, lloffset)
479479 }
480480 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) ;
482482 let lllen = cg_base. len ( bx. cx ( ) ) ;
483483 let llindex = bx. sub ( lllen, lloffset) ;
484484 cg_base. project_index ( bx, llindex)
485485 }
486486 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) ) ;
488488 let projected_ty =
489489 PlaceTy :: from_ty ( cg_base. layout . ty ) . projection_ty ( tcx, * elem) . ty ;
490490 subslice. layout = bx. cx ( ) . layout_of ( self . monomorphize ( projected_ty) ) ;
491491
492492 if subslice. layout . is_unsized ( ) {
493493 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) ) ) ;
498496 }
499497
500498 subslice
0 commit comments