@@ -537,14 +537,14 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
537
537
538
538
ty:: TyRef ( _, ty:: mt { ty, mutbl } ) => {
539
539
match ty. sty {
540
- ty:: TyArray ( _, Some ( n ) ) => match ctor {
540
+ ty:: TyArray ( _, n ) => match ctor {
541
541
& Single => {
542
542
assert_eq ! ( pats_len, n) ;
543
543
ast:: PatVec ( pats. collect ( ) , None , vec ! ( ) )
544
544
} ,
545
545
_ => unreachable ! ( )
546
546
} ,
547
- ty:: TyArray ( _ , None ) => match ctor {
547
+ ty:: TySlice ( _ ) => match ctor {
548
548
& Slice ( n) => {
549
549
assert_eq ! ( pats_len, n) ;
550
550
ast:: PatVec ( pats. collect ( ) , None , vec ! ( ) )
@@ -560,7 +560,7 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
560
560
}
561
561
}
562
562
563
- ty:: TyArray ( _, Some ( len) ) => {
563
+ ty:: TyArray ( _, len) => {
564
564
assert_eq ! ( pats_len, len) ;
565
565
ast:: PatVec ( pats. collect ( ) , None , vec ! [ ] )
566
566
}
@@ -601,7 +601,7 @@ fn all_constructors(cx: &MatchCheckCtxt, left_ty: Ty,
601
601
[ true , false ] . iter ( ) . map ( |b| ConstantValue ( const_bool ( * b) ) ) . collect ( ) ,
602
602
603
603
ty:: TyRef ( _, ty:: mt { ty, .. } ) => match ty. sty {
604
- ty:: TyArray ( _ , None ) =>
604
+ ty:: TySlice ( _ ) =>
605
605
range_inclusive ( 0 , max_slice_length) . map ( |length| Slice ( length) ) . collect ( ) ,
606
606
_ => vec ! ( Single )
607
607
} ,
@@ -779,7 +779,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
779
779
vec ! ( ConstantRange ( eval_const_expr( cx. tcx, & * * lo) , eval_const_expr( cx. tcx, & * * hi) ) ) ,
780
780
ast:: PatVec ( ref before, ref slice, ref after) =>
781
781
match left_ty. sty {
782
- ty:: TyArray ( _, Some ( _ ) ) => vec ! ( Single ) ,
782
+ ty:: TyArray ( _, _ ) => vec ! ( Single ) ,
783
783
_ => if slice. is_some ( ) {
784
784
range_inclusive ( before. len ( ) + after. len ( ) , max_slice_length)
785
785
. map ( |length| Slice ( length) )
@@ -807,7 +807,7 @@ pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usi
807
807
ty:: TyTuple ( ref fs) => fs. len ( ) ,
808
808
ty:: TyBox ( _) => 1 ,
809
809
ty:: TyRef ( _, ty:: mt { ty, .. } ) => match ty. sty {
810
- ty:: TyArray ( _ , None ) => match * ctor {
810
+ ty:: TySlice ( _ ) => match * ctor {
811
811
Slice ( length) => length,
812
812
ConstantValue ( _) => 0 ,
813
813
_ => unreachable ! ( )
@@ -822,7 +822,7 @@ pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usi
822
822
}
823
823
}
824
824
ty:: TyStruct ( cid, _) => ty:: lookup_struct_fields ( cx. tcx , cid) . len ( ) ,
825
- ty:: TyArray ( _, Some ( n ) ) => n,
825
+ ty:: TyArray ( _, n ) => n,
826
826
_ => 0
827
827
}
828
828
}
0 commit comments