@@ -23,7 +23,7 @@ pub(super) fn check<'tcx>(
23
23
unsized_ty,
24
24
to_ty : to_sub_ty,
25
25
} => match reduce_ty ( cx, to_sub_ty) {
26
- ReducedTy :: IntArray | ReducedTy :: TypeErasure => break ,
26
+ ReducedTy :: TypeErasure => break ,
27
27
ReducedTy :: UnorderedFields ( ty) if is_size_pair ( ty) => break ,
28
28
ReducedTy :: Ref ( to_sub_ty) => {
29
29
from_ty = unsized_ty;
@@ -49,7 +49,7 @@ pub(super) fn check<'tcx>(
49
49
unsized_ty,
50
50
from_ty : from_sub_ty,
51
51
} => match reduce_ty ( cx, from_sub_ty) {
52
- ReducedTy :: IntArray | ReducedTy :: TypeErasure => break ,
52
+ ReducedTy :: TypeErasure => break ,
53
53
ReducedTy :: UnorderedFields ( ty) if is_size_pair ( ty) => break ,
54
54
ReducedTy :: Ref ( from_sub_ty) => {
55
55
from_ty = from_sub_ty;
@@ -125,8 +125,7 @@ pub(super) fn check<'tcx>(
125
125
from_ty : from_sub_ty,
126
126
to_ty : to_sub_ty,
127
127
} => match ( reduce_ty ( cx, from_sub_ty) , reduce_ty ( cx, to_sub_ty) ) {
128
- ( ReducedTy :: IntArray | ReducedTy :: TypeErasure , _)
129
- | ( _, ReducedTy :: IntArray | ReducedTy :: TypeErasure ) => return false ,
128
+ ( ReducedTy :: TypeErasure , _) | ( _, ReducedTy :: TypeErasure ) => return false ,
130
129
( ReducedTy :: UnorderedFields ( from_ty) , ReducedTy :: UnorderedFields ( to_ty) ) if from_ty != to_ty => {
131
130
span_lint_and_then (
132
131
cx,
@@ -265,9 +264,6 @@ enum ReducedTy<'tcx> {
265
264
UnorderedFields ( Ty < ' tcx > ) ,
266
265
/// The type is a reference to the contained type.
267
266
Ref ( Ty < ' tcx > ) ,
268
- /// The type is an array of a primitive integer type. These can be used as storage for a value
269
- /// of another type.
270
- IntArray ,
271
267
/// Any other type.
272
268
Other ( Ty < ' tcx > ) ,
273
269
}
@@ -277,7 +273,7 @@ fn reduce_ty<'tcx>(cx: &LateContext<'tcx>, mut ty: Ty<'tcx>) -> ReducedTy<'tcx>
277
273
loop {
278
274
ty = cx. tcx . try_normalize_erasing_regions ( cx. param_env , ty) . unwrap_or ( ty) ;
279
275
return match * ty. kind ( ) {
280
- ty:: Array ( sub_ty, _) if matches ! ( sub_ty. kind( ) , ty:: Int ( _) | ty:: Uint ( _) ) => ReducedTy :: IntArray ,
276
+ ty:: Array ( sub_ty, _) if matches ! ( sub_ty. kind( ) , ty:: Int ( _) | ty:: Uint ( _) ) => ReducedTy :: TypeErasure ,
281
277
ty:: Array ( sub_ty, _) | ty:: Slice ( sub_ty) => {
282
278
ty = sub_ty;
283
279
continue ;
0 commit comments