@@ -1028,7 +1028,7 @@ impl ProjectionElem {
10281028 ProjectionElem :: Field ( _idx, fty) => Ok ( * fty) ,
10291029 ProjectionElem :: Index ( _) | ProjectionElem :: ConstantIndex { .. } => Self :: index_ty ( ty) ,
10301030 ProjectionElem :: Subslice { from, to, from_end } => {
1031- Self :: subslice_ty ( ty, from, to, from_end)
1031+ Self :: subslice_ty ( ty, * from, * to, * from_end)
10321032 }
10331033 ProjectionElem :: Downcast ( _) => Ok ( ty) ,
10341034 ProjectionElem :: OpaqueCast ( ty) | ProjectionElem :: Subtype ( ty) => Ok ( * ty) ,
@@ -1039,13 +1039,13 @@ impl ProjectionElem {
10391039 ty. kind ( ) . builtin_index ( ) . ok_or_else ( || error ! ( "Cannot index non-array type: {ty:?}" ) )
10401040 }
10411041
1042- fn subslice_ty ( ty : Ty , from : & u64 , to : & u64 , from_end : & bool ) -> Result < Ty , Error > {
1042+ fn subslice_ty ( ty : Ty , from : u64 , to : u64 , from_end : bool ) -> Result < Ty , Error > {
10431043 let ty_kind = ty. kind ( ) ;
10441044 match ty_kind {
10451045 TyKind :: RigidTy ( RigidTy :: Slice ( ..) ) => Ok ( ty) ,
10461046 TyKind :: RigidTy ( RigidTy :: Array ( inner, _) ) if !from_end => Ty :: try_new_array (
10471047 inner,
1048- to. checked_sub ( * from) . ok_or_else ( || error ! ( "Subslice overflow: {from}..{to}" ) ) ?,
1048+ to. checked_sub ( from) . ok_or_else ( || error ! ( "Subslice overflow: {from}..{to}" ) ) ?,
10491049 ) ,
10501050 TyKind :: RigidTy ( RigidTy :: Array ( inner, size) ) => {
10511051 let size = size. eval_target_usize ( ) ?;
0 commit comments