@@ -137,7 +137,9 @@ type creader_cache = @mut HashMap<creader_cache_key, t>;
137
137
138
138
impl to_bytes:: IterBytes for creader_cache_key {
139
139
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
140
- to_bytes:: iter_bytes_3 ( & self . cnum , & self . pos , & self . len , lsb0, f)
140
+ self . cnum . iter_bytes ( lsb0, f) &&
141
+ self . pos . iter_bytes ( lsb0, f) &&
142
+ self . len . iter_bytes ( lsb0, f)
141
143
}
142
144
}
143
145
@@ -392,14 +394,19 @@ pub struct FnSig {
392
394
393
395
impl to_bytes:: IterBytes for BareFnTy {
394
396
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
395
- to_bytes:: iter_bytes_3 ( & self . purity , & self . abis , & self . sig , lsb0, f)
397
+ self . purity . iter_bytes ( lsb0, f) &&
398
+ self . abis . iter_bytes ( lsb0, f) &&
399
+ self . sig . iter_bytes ( lsb0, f)
396
400
}
397
401
}
398
402
399
403
impl to_bytes:: IterBytes for ClosureTy {
400
404
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
401
- to_bytes:: iter_bytes_5 ( & self . purity , & self . sigil , & self . onceness ,
402
- & self . region , & self . sig , lsb0, f)
405
+ self . purity . iter_bytes ( lsb0, f) &&
406
+ self . sigil . iter_bytes ( lsb0, f) &&
407
+ self . onceness . iter_bytes ( lsb0, f) &&
408
+ self . region . iter_bytes ( lsb0, f) &&
409
+ self . sig . iter_bytes ( lsb0, f)
403
410
}
404
411
}
405
412
@@ -717,9 +724,15 @@ pub enum InferTy {
717
724
impl to_bytes:: IterBytes for InferTy {
718
725
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
719
726
match * self {
720
- TyVar ( ref tv) => to_bytes:: iter_bytes_2 ( & 0u8 , tv, lsb0, f) ,
721
- IntVar ( ref iv) => to_bytes:: iter_bytes_2 ( & 1u8 , iv, lsb0, f) ,
722
- FloatVar ( ref fv) => to_bytes:: iter_bytes_2 ( & 2u8 , fv, lsb0, f) ,
727
+ TyVar ( ref tv) => {
728
+ 0u8 . iter_bytes ( lsb0, f) && tv. iter_bytes ( lsb0, f)
729
+ }
730
+ IntVar ( ref iv) => {
731
+ 1u8 . iter_bytes ( lsb0, f) && iv. iter_bytes ( lsb0, f)
732
+ }
733
+ FloatVar ( ref fv) => {
734
+ 2u8 . iter_bytes ( lsb0, f) && fv. iter_bytes ( lsb0, f)
735
+ }
723
736
}
724
737
}
725
738
}
@@ -733,8 +746,12 @@ pub enum InferRegion {
733
746
impl to_bytes:: IterBytes for InferRegion {
734
747
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
735
748
match * self {
736
- ReVar ( ref rv) => to_bytes:: iter_bytes_2 ( & 0u8 , rv, lsb0, f) ,
737
- ReSkolemized ( ref v, _) => to_bytes:: iter_bytes_2 ( & 1u8 , v, lsb0, f)
749
+ ReVar ( ref rv) => {
750
+ 0u8 . iter_bytes ( lsb0, f) && rv. iter_bytes ( lsb0, f)
751
+ }
752
+ ReSkolemized ( ref v, _) => {
753
+ 1u8 . iter_bytes ( lsb0, f) && v. iter_bytes ( lsb0, f)
754
+ }
738
755
}
739
756
}
740
757
}
@@ -2626,119 +2643,115 @@ impl cmp::TotalEq for bound_region {
2626
2643
impl to_bytes:: IterBytes for vstore {
2627
2644
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
2628
2645
match * self {
2629
- vstore_fixed( ref u) =>
2630
- to_bytes :: iter_bytes_2 ( & 0u8 , u , lsb0, f) ,
2631
-
2632
- vstore_uniq => 1u8 . iter_bytes ( lsb0, f) ,
2633
- vstore_box => 2u8 . iter_bytes ( lsb0, f) ,
2646
+ vstore_fixed( ref u) => {
2647
+ 0u8 . iter_bytes ( lsb0 , f ) && u . iter_bytes ( lsb0, f)
2648
+ }
2649
+ vstore_uniq => 1u8 . iter_bytes ( lsb0, f) ,
2650
+ vstore_box => 2u8 . iter_bytes ( lsb0, f) ,
2634
2651
2635
- vstore_slice( ref r) =>
2636
- to_bytes:: iter_bytes_2 ( & 3u8 , r, lsb0, f) ,
2652
+ vstore_slice( ref r) => {
2653
+ 3u8 . iter_bytes ( lsb0, f) && r. iter_bytes ( lsb0, f)
2654
+ }
2637
2655
}
2638
2656
}
2639
2657
}
2640
2658
2641
2659
impl to_bytes:: IterBytes for substs {
2642
2660
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
2643
- to_bytes :: iter_bytes_3 ( & self . self_r ,
2644
- & self . self_ty ,
2645
- & self . tps , lsb0, f)
2661
+ self . self_r . iter_bytes ( lsb0 , f ) &&
2662
+ self . self_ty . iter_bytes ( lsb0 , f ) &&
2663
+ self . tps . iter_bytes ( lsb0, f)
2646
2664
}
2647
2665
}
2648
2666
2649
2667
impl to_bytes:: IterBytes for mt {
2650
2668
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
2651
- to_bytes:: iter_bytes_2 ( & self . ty ,
2652
- & self . mutbl , lsb0, f)
2669
+ self . ty . iter_bytes ( lsb0, f) && self . mutbl . iter_bytes ( lsb0, f)
2653
2670
}
2654
2671
}
2655
2672
2656
2673
impl to_bytes:: IterBytes for field {
2657
2674
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
2658
- to_bytes:: iter_bytes_2 ( & self . ident ,
2659
- & self . mt , lsb0, f)
2675
+ self . ident . iter_bytes ( lsb0, f) && self . mt . iter_bytes ( lsb0, f)
2660
2676
}
2661
2677
}
2662
2678
2663
2679
impl to_bytes:: IterBytes for FnSig {
2664
2680
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
2665
- to_bytes:: iter_bytes_2 ( & self . inputs ,
2666
- & self . output ,
2667
- lsb0, f)
2681
+ self . inputs . iter_bytes ( lsb0, f) && self . output . iter_bytes ( lsb0, f)
2668
2682
}
2669
2683
}
2670
2684
2671
2685
impl to_bytes:: IterBytes for sty {
2672
2686
fn iter_bytes ( & self , lsb0 : bool , f : to_bytes:: Cb ) -> bool {
2673
2687
match * self {
2674
- ty_nil => 0u8 . iter_bytes ( lsb0, f) ,
2675
- ty_bool => 1u8 . iter_bytes ( lsb0, f) ,
2688
+ ty_nil => 0u8 . iter_bytes ( lsb0, f) ,
2689
+ ty_bool => 1u8 . iter_bytes ( lsb0, f) ,
2676
2690
2677
- ty_int( ref t) =>
2678
- to_bytes:: iter_bytes_2 ( & 2u8 , t, lsb0, f) ,
2691
+ ty_int( ref t) => 2u8 . iter_bytes ( lsb0, f) && t. iter_bytes ( lsb0, f) ,
2679
2692
2680
- ty_uint( ref t) =>
2681
- to_bytes:: iter_bytes_2 ( & 3u8 , t, lsb0, f) ,
2693
+ ty_uint( ref t) => 3u8 . iter_bytes ( lsb0, f) && t. iter_bytes ( lsb0, f) ,
2682
2694
2683
- ty_float( ref t) =>
2684
- to_bytes:: iter_bytes_2 ( & 4u8 , t, lsb0, f) ,
2695
+ ty_float( ref t) => 4u8 . iter_bytes ( lsb0, f) && t. iter_bytes ( lsb0, f) ,
2685
2696
2686
- ty_estr( ref v) =>
2687
- to_bytes:: iter_bytes_2 ( & 5u8 , v, lsb0, f) ,
2697
+ ty_estr( ref v) => 5u8 . iter_bytes ( lsb0, f) && v. iter_bytes ( lsb0, f) ,
2688
2698
2689
- ty_enum( ref did, ref substs) =>
2690
- to_bytes:: iter_bytes_3 ( & 6u8 , did, substs, lsb0, f) ,
2699
+ ty_enum( ref did, ref substs) => {
2700
+ 6u8 . iter_bytes ( lsb0, f) &&
2701
+ did. iter_bytes ( lsb0, f) &&
2702
+ substs. iter_bytes ( lsb0, f)
2703
+ }
2691
2704
2692
- ty_box( ref mt) =>
2693
- to_bytes:: iter_bytes_2 ( & 7u8 , mt, lsb0, f) ,
2705
+ ty_box( ref mt) => 7u8 . iter_bytes ( lsb0, f) && mt. iter_bytes ( lsb0, f) ,
2694
2706
2695
- ty_evec( ref mt, ref v) =>
2696
- to_bytes:: iter_bytes_3 ( & 8u8 , mt, v, lsb0, f) ,
2707
+ ty_evec( ref mt, ref v) => {
2708
+ 8u8 . iter_bytes ( lsb0, f) &&
2709
+ mt. iter_bytes ( lsb0, f) &&
2710
+ v. iter_bytes ( lsb0, f)
2711
+ }
2697
2712
2698
- ty_unboxed_vec( ref mt) =>
2699
- to_bytes:: iter_bytes_2 ( & 9u8 , mt, lsb0, f) ,
2713
+ ty_unboxed_vec( ref mt) => 9u8 . iter_bytes ( lsb0, f) && mt. iter_bytes ( lsb0, f) ,
2700
2714
2701
- ty_tup( ref ts) =>
2702
- to_bytes:: iter_bytes_2 ( & 10u8 , ts, lsb0, f) ,
2715
+ ty_tup( ref ts) => 10u8 . iter_bytes ( lsb0, f) && ts. iter_bytes ( lsb0, f) ,
2703
2716
2704
- ty_bare_fn( ref ft) =>
2705
- to_bytes:: iter_bytes_2 ( & 12u8 , ft, lsb0, f) ,
2717
+ ty_bare_fn( ref ft) => 12u8 . iter_bytes ( lsb0, f) && ft. iter_bytes ( lsb0, f) ,
2706
2718
2707
- ty_self( ref did) => to_bytes :: iter_bytes_2 ( & 13u8 , did , lsb0, f) ,
2719
+ ty_self( ref did) => 13u8 . iter_bytes ( lsb0 , f ) && did . iter_bytes ( lsb0, f) ,
2708
2720
2709
- ty_infer( ref v) =>
2710
- to_bytes:: iter_bytes_2 ( & 14u8 , v, lsb0, f) ,
2721
+ ty_infer( ref v) => 14u8 . iter_bytes ( lsb0, f) && v. iter_bytes ( lsb0, f) ,
2711
2722
2712
- ty_param( ref p) =>
2713
- to_bytes:: iter_bytes_2 ( & 15u8 , p, lsb0, f) ,
2723
+ ty_param( ref p) => 15u8 . iter_bytes ( lsb0, f) && p. iter_bytes ( lsb0, f) ,
2714
2724
2715
- ty_type => 16u8 . iter_bytes ( lsb0, f) ,
2716
- ty_bot => 17u8 . iter_bytes ( lsb0, f) ,
2725
+ ty_type => 16u8 . iter_bytes ( lsb0, f) ,
2726
+ ty_bot => 17u8 . iter_bytes ( lsb0, f) ,
2717
2727
2718
- ty_ptr( ref mt) =>
2719
- to_bytes:: iter_bytes_2 ( & 18u8 , mt, lsb0, f) ,
2728
+ ty_ptr( ref mt) => 18u8 . iter_bytes ( lsb0, f) && mt. iter_bytes ( lsb0, f) ,
2720
2729
2721
- ty_uniq( ref mt) =>
2722
- to_bytes:: iter_bytes_2 ( & 19u8 , mt, lsb0, f) ,
2730
+ ty_uniq( ref mt) => 19u8 . iter_bytes ( lsb0, f) && mt. iter_bytes ( lsb0, f) ,
2723
2731
2724
- ty_trait( ref did, ref substs, ref v, ref mutbl) =>
2725
- to_bytes:: iter_bytes_5 ( & 20u8 , did, substs, v, mutbl, lsb0, f) ,
2732
+ ty_trait( ref did, ref substs, ref v, ref mutbl) => {
2733
+ 20u8 . iter_bytes ( lsb0, f) &&
2734
+ did. iter_bytes ( lsb0, f) &&
2735
+ substs. iter_bytes ( lsb0, f) &&
2736
+ v. iter_bytes ( lsb0, f) &&
2737
+ mutbl. iter_bytes ( lsb0, f)
2738
+ }
2726
2739
2727
- ty_opaque_closure_ptr( ref ck) =>
2728
- to_bytes:: iter_bytes_2 ( & 21u8 , ck, lsb0, f) ,
2740
+ ty_opaque_closure_ptr( ref ck) => 21u8 . iter_bytes ( lsb0, f) && ck. iter_bytes ( lsb0, f) ,
2729
2741
2730
- ty_opaque_box => 22u8 . iter_bytes ( lsb0, f) ,
2742
+ ty_opaque_box => 22u8 . iter_bytes ( lsb0, f) ,
2731
2743
2732
- ty_struct( ref did, ref substs) =>
2733
- to_bytes:: iter_bytes_3 ( & 23u8 , did, substs, lsb0, f) ,
2744
+ ty_struct( ref did, ref substs) => {
2745
+ 23u8 . iter_bytes ( lsb0, f) && did. iter_bytes ( lsb0, f) && substs. iter_bytes ( lsb0, f)
2746
+ }
2734
2747
2735
- ty_rptr( ref r, ref mt) =>
2736
- to_bytes:: iter_bytes_3 ( & 24u8 , r, mt, lsb0, f) ,
2748
+ ty_rptr( ref r, ref mt) => {
2749
+ 24u8 . iter_bytes ( lsb0, f) && r. iter_bytes ( lsb0, f) && mt. iter_bytes ( lsb0, f)
2750
+ }
2737
2751
2738
- ty_err => 25u8 . iter_bytes ( lsb0, f) ,
2752
+ ty_err => 25u8 . iter_bytes ( lsb0, f) ,
2739
2753
2740
- ty_closure( ref ct) =>
2741
- to_bytes:: iter_bytes_2 ( & 26u8 , ct, lsb0, f) ,
2754
+ ty_closure( ref ct) => 26u8 . iter_bytes ( lsb0, f) && ct. iter_bytes ( lsb0, f) ,
2742
2755
}
2743
2756
}
2744
2757
}
0 commit comments