@@ -55,7 +55,7 @@ impl<'tcx> PlaceTy<'tcx> {
55
55
/// `PlaceElem`, where we can just use the `Ty` that is already
56
56
/// stored inline on field projection elems.
57
57
pub fn projection_ty ( self , tcx : TyCtxt < ' tcx > , elem : PlaceElem < ' tcx > ) -> PlaceTy < ' tcx > {
58
- self . projection_ty_core ( tcx, ty :: ParamEnv :: empty ( ) , & elem, |_, _, ty| ty, |_, ty| ty)
58
+ self . projection_ty_core ( tcx, & elem, |_, _, ty| ty, |_, ty| ty)
59
59
}
60
60
61
61
/// `place_ty.projection_ty_core(tcx, elem, |...| { ... })`
@@ -66,7 +66,6 @@ impl<'tcx> PlaceTy<'tcx> {
66
66
pub fn projection_ty_core < V , T > (
67
67
self ,
68
68
tcx : TyCtxt < ' tcx > ,
69
- param_env : ty:: ParamEnv < ' tcx > ,
70
69
elem : & ProjectionElem < V , T > ,
71
70
mut handle_field : impl FnMut ( & Self , FieldIdx , T ) -> Ty < ' tcx > ,
72
71
mut handle_opaque_cast_and_subtype : impl FnMut ( & Self , T ) -> Ty < ' tcx > ,
@@ -93,7 +92,9 @@ impl<'tcx> PlaceTy<'tcx> {
93
92
ty:: Slice ( ..) => self . ty ,
94
93
ty:: Array ( inner, _) if !from_end => Ty :: new_array ( tcx, * inner, to - from) ,
95
94
ty:: Array ( inner, size) if from_end => {
96
- let size = size. eval_target_usize ( tcx, param_env) ;
95
+ let size = size
96
+ . try_to_target_usize ( tcx)
97
+ . expect ( "expected subslice projection on fixed-size array" ) ;
97
98
let len = size - from - to;
98
99
Ty :: new_array ( tcx, * inner, len)
99
100
}
0 commit comments