@@ -234,7 +234,7 @@ fn check_for_bindings_named_the_same_as_variants(cx: &MatchCheckCtxt, pat: &Pat)
234234 match p. node {
235235 ast:: PatIdent ( ast:: BindByValue ( ast:: MutImmutable ) , ident, None ) => {
236236 let pat_ty = ty:: pat_ty ( cx. tcx , p) ;
237- if let ty:: ty_enum ( def_id, _) = pat_ty. sty {
237+ if let ty:: TyEnum ( def_id, _) = pat_ty. sty {
238238 let def = cx. tcx . def_map . borrow ( ) . get ( & p. id ) . map ( |d| d. full_def ( ) ) ;
239239 if let Some ( DefLocal ( _) ) = def {
240240 if ty:: enum_variants ( cx. tcx , def_id) . iter ( ) . any ( |variant|
@@ -506,9 +506,9 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
506506 let pats_len = pats. len ( ) ;
507507 let mut pats = pats. into_iter ( ) . map ( |p| P ( ( * p) . clone ( ) ) ) ;
508508 let pat = match left_ty. sty {
509- ty:: ty_tup ( _) => ast:: PatTup ( pats. collect ( ) ) ,
509+ ty:: TyTuple ( _) => ast:: PatTup ( pats. collect ( ) ) ,
510510
511- ty:: ty_enum ( cid, _) | ty:: ty_struct ( cid, _) => {
511+ ty:: TyEnum ( cid, _) | ty:: TyStruct ( cid, _) => {
512512 let ( vid, is_structure) = match ctor {
513513 & Variant ( vid) =>
514514 ( vid, ty:: enum_variant_with_id ( cx. tcx , cid, vid) . arg_names . is_some ( ) ) ,
@@ -535,23 +535,23 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
535535 }
536536 }
537537
538- ty:: ty_rptr ( _, ty:: mt { ty, mutbl } ) => {
538+ ty:: TyRef ( _, ty:: mt { ty, mutbl } ) => {
539539 match ty. sty {
540- ty:: ty_vec ( _, Some ( n) ) => match ctor {
540+ ty:: TyArray ( _, Some ( n) ) => match ctor {
541541 & Single => {
542542 assert_eq ! ( pats_len, n) ;
543543 ast:: PatVec ( pats. collect ( ) , None , vec ! ( ) )
544544 } ,
545545 _ => unreachable ! ( )
546546 } ,
547- ty:: ty_vec ( _, None ) => match ctor {
547+ ty:: TyArray ( _, None ) => match ctor {
548548 & Slice ( n) => {
549549 assert_eq ! ( pats_len, n) ;
550550 ast:: PatVec ( pats. collect ( ) , None , vec ! ( ) )
551551 } ,
552552 _ => unreachable ! ( )
553553 } ,
554- ty:: ty_str => ast:: PatWild ( ast:: PatWildSingle ) ,
554+ ty:: TyStr => ast:: PatWild ( ast:: PatWildSingle ) ,
555555
556556 _ => {
557557 assert_eq ! ( pats_len, 1 ) ;
@@ -560,7 +560,7 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
560560 }
561561 }
562562
563- ty:: ty_vec ( _, Some ( len) ) => {
563+ ty:: TyArray ( _, Some ( len) ) => {
564564 assert_eq ! ( pats_len, len) ;
565565 ast:: PatVec ( pats. collect ( ) , None , vec ! [ ] )
566566 }
@@ -597,16 +597,16 @@ fn missing_constructor(cx: &MatchCheckCtxt, &Matrix(ref rows): &Matrix,
597597fn all_constructors ( cx : & MatchCheckCtxt , left_ty : Ty ,
598598 max_slice_length : usize ) -> Vec < Constructor > {
599599 match left_ty. sty {
600- ty:: ty_bool =>
600+ ty:: TyBool =>
601601 [ true , false ] . iter ( ) . map ( |b| ConstantValue ( const_bool ( * b) ) ) . collect ( ) ,
602602
603- ty:: ty_rptr ( _, ty:: mt { ty, .. } ) => match ty. sty {
604- ty:: ty_vec ( _, None ) =>
603+ ty:: TyRef ( _, ty:: mt { ty, .. } ) => match ty. sty {
604+ ty:: TyArray ( _, None ) =>
605605 range_inclusive ( 0 , max_slice_length) . map ( |length| Slice ( length) ) . collect ( ) ,
606606 _ => vec ! ( Single )
607607 } ,
608608
609- ty:: ty_enum ( eid, _) =>
609+ ty:: TyEnum ( eid, _) =>
610610 ty:: enum_variants ( cx. tcx , eid)
611611 . iter ( )
612612 . map ( |va| Variant ( va. id ) )
@@ -779,7 +779,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
779779 vec ! ( ConstantRange ( eval_const_expr( cx. tcx, & * * lo) , eval_const_expr( cx. tcx, & * * hi) ) ) ,
780780 ast:: PatVec ( ref before, ref slice, ref after) =>
781781 match left_ty. sty {
782- ty:: ty_vec ( _, Some ( _) ) => vec ! ( Single ) ,
782+ ty:: TyArray ( _, Some ( _) ) => vec ! ( Single ) ,
783783 _ => if slice. is_some ( ) {
784784 range_inclusive ( before. len ( ) + after. len ( ) , max_slice_length)
785785 . map ( |length| Slice ( length) )
@@ -804,25 +804,25 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
804804/// A struct pattern's arity is the number of fields it contains, etc.
805805pub fn constructor_arity ( cx : & MatchCheckCtxt , ctor : & Constructor , ty : Ty ) -> usize {
806806 match ty. sty {
807- ty:: ty_tup ( ref fs) => fs. len ( ) ,
808- ty:: ty_uniq ( _) => 1 ,
809- ty:: ty_rptr ( _, ty:: mt { ty, .. } ) => match ty. sty {
810- ty:: ty_vec ( _, None ) => match * ctor {
807+ ty:: TyTuple ( ref fs) => fs. len ( ) ,
808+ ty:: TyBox ( _) => 1 ,
809+ ty:: TyRef ( _, ty:: mt { ty, .. } ) => match ty. sty {
810+ ty:: TyArray ( _, None ) => match * ctor {
811811 Slice ( length) => length,
812812 ConstantValue ( _) => 0 ,
813813 _ => unreachable ! ( )
814814 } ,
815- ty:: ty_str => 0 ,
815+ ty:: TyStr => 0 ,
816816 _ => 1
817817 } ,
818- ty:: ty_enum ( eid, _) => {
818+ ty:: TyEnum ( eid, _) => {
819819 match * ctor {
820820 Variant ( id) => enum_variant_with_id ( cx. tcx , eid, id) . args . len ( ) ,
821821 _ => unreachable ! ( )
822822 }
823823 }
824- ty:: ty_struct ( cid, _) => ty:: lookup_struct_fields ( cx. tcx , cid) . len ( ) ,
825- ty:: ty_vec ( _, Some ( n) ) => n,
824+ ty:: TyStruct ( cid, _) => ty:: lookup_struct_fields ( cx. tcx , cid) . len ( ) ,
825+ ty:: TyArray ( _, Some ( n) ) => n,
826826 _ => 0
827827 }
828828}
0 commit comments