@@ -287,9 +287,8 @@ macro_rules! binary_func {
287
287
/// - Only one element in `lhs` or `rhs` along a given dimension/axis
288
288
pub fn $fn_name<A , B >( lhs: & Array <A >, rhs: & Array <B >, batch: bool ) -> Array <A :: Output >
289
289
where
290
- A : HasAfEnum + ImplicitPromote <B >,
291
- B : HasAfEnum + ImplicitPromote <A >,
292
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
290
+ A : ImplicitPromote <B >,
291
+ B : ImplicitPromote <A >,
293
292
{
294
293
unsafe {
295
294
let mut temp: af_array = std:: ptr:: null_mut( ) ;
@@ -378,8 +377,7 @@ pub trait Convertable {
378
377
379
378
impl < T > Convertable for T
380
379
where
381
- T : Clone + HasAfEnum + ConstGenerator < OutType = T > ,
382
- <T as ConstGenerator >:: OutType : HasAfEnum ,
380
+ T : Clone + ConstGenerator < OutType = T > ,
383
381
{
384
382
type OutType = T ;
385
383
@@ -400,9 +398,8 @@ macro_rules! overloaded_binary_func {
400
398
( $doc_str: expr, $fn_name: ident, $help_name: ident, $ffi_name: ident) => {
401
399
fn $help_name<A , B >( lhs: & Array <A >, rhs: & Array <B >, batch: bool ) -> Array <A :: Output >
402
400
where
403
- A : HasAfEnum + ImplicitPromote <B >,
404
- B : HasAfEnum + ImplicitPromote <A >,
405
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
401
+ A : ImplicitPromote <B >,
402
+ B : ImplicitPromote <A >,
406
403
{
407
404
unsafe {
408
405
let mut temp: af_array = std:: ptr:: null_mut( ) ;
@@ -453,10 +450,8 @@ macro_rules! overloaded_binary_func {
453
450
where
454
451
T : Convertable ,
455
452
U : Convertable ,
456
- <T as Convertable >:: OutType : HasAfEnum + ImplicitPromote <<U as Convertable >:: OutType >,
457
- <U as Convertable >:: OutType : HasAfEnum + ImplicitPromote <<T as Convertable >:: OutType >,
458
- <<T as Convertable >:: OutType as ImplicitPromote <<U as Convertable >:: OutType >>:: Output :
459
- HasAfEnum ,
453
+ <T as Convertable >:: OutType : ImplicitPromote <<U as Convertable >:: OutType >,
454
+ <U as Convertable >:: OutType : ImplicitPromote <<T as Convertable >:: OutType >,
460
455
{
461
456
let lhs = arg1. convert( ) ; // Convert to Array<T>
462
457
let rhs = arg2. convert( ) ; // Convert to Array<T>
@@ -507,8 +502,8 @@ macro_rules! overloaded_compare_func {
507
502
( $doc_str: expr, $fn_name: ident, $help_name: ident, $ffi_name: ident) => {
508
503
fn $help_name<A , B >( lhs: & Array <A >, rhs: & Array <B >, batch: bool ) -> Array <bool >
509
504
where
510
- A : HasAfEnum + ImplicitPromote <B >,
511
- B : HasAfEnum + ImplicitPromote <A >,
505
+ A : ImplicitPromote <B >,
506
+ B : ImplicitPromote <A >,
512
507
{
513
508
unsafe {
514
509
let mut temp: af_array = std:: ptr:: null_mut( ) ;
@@ -557,8 +552,8 @@ macro_rules! overloaded_compare_func {
557
552
where
558
553
T : Convertable ,
559
554
U : Convertable ,
560
- <T as Convertable >:: OutType : HasAfEnum + ImplicitPromote <<U as Convertable >:: OutType >,
561
- <U as Convertable >:: OutType : HasAfEnum + ImplicitPromote <<T as Convertable >:: OutType >,
555
+ <T as Convertable >:: OutType : ImplicitPromote <<U as Convertable >:: OutType >,
556
+ <U as Convertable >:: OutType : ImplicitPromote <<T as Convertable >:: OutType >,
562
557
{
563
558
let lhs = arg1. convert( ) ; // Convert to Array<T>
564
559
let rhs = arg2. convert( ) ; // Convert to Array<T>
@@ -615,9 +610,8 @@ fn clamp_helper<X, Y>(
615
610
batch : bool ,
616
611
) -> Array < <X as ImplicitPromote < Y > >:: Output >
617
612
where
618
- X : HasAfEnum + ImplicitPromote < Y > ,
619
- Y : HasAfEnum + ImplicitPromote < X > ,
620
- <X as ImplicitPromote < Y > >:: Output : HasAfEnum ,
613
+ X : ImplicitPromote < Y > ,
614
+ Y : ImplicitPromote < X > ,
621
615
{
622
616
unsafe {
623
617
let mut temp: af_array = std:: ptr:: null_mut ( ) ;
@@ -667,10 +661,9 @@ pub fn clamp<T, C>(
667
661
batch : bool ,
668
662
) -> Array < <T as ImplicitPromote < <C as Convertable >:: OutType > >:: Output >
669
663
where
670
- T : HasAfEnum + ImplicitPromote < <C as Convertable >:: OutType > ,
664
+ T : ImplicitPromote < <C as Convertable >:: OutType > ,
671
665
C : Convertable ,
672
- <C as Convertable >:: OutType : HasAfEnum + ImplicitPromote < T > ,
673
- <T as ImplicitPromote < <C as Convertable >:: OutType > >:: Output : HasAfEnum ,
666
+ <C as Convertable >:: OutType : ImplicitPromote < T > ,
674
667
{
675
668
let lo = arg1. convert ( ) ; // Convert to Array<T>
676
669
let hi = arg2. convert ( ) ; // Convert to Array<T>
@@ -697,8 +690,8 @@ macro_rules! arith_rhs_scalar_func {
697
690
// Implement (&Array<T> op_name rust_type)
698
691
impl <' f, T , U > $op_name<U > for & ' f Array <T >
699
692
where
700
- T : HasAfEnum + ImplicitPromote <U >,
701
- U : HasAfEnum + ImplicitPromote <T > + Clone + ConstGenerator <OutType = U >,
693
+ T : ImplicitPromote <U >,
694
+ U : ImplicitPromote <T > + Clone + ConstGenerator <OutType = U >,
702
695
{
703
696
type Output = Array <<T as ImplicitPromote <U >>:: Output >;
704
697
@@ -711,8 +704,8 @@ macro_rules! arith_rhs_scalar_func {
711
704
// Implement (Array<T> op_name rust_type)
712
705
impl <T , U > $op_name<U > for Array <T >
713
706
where
714
- T : HasAfEnum + ImplicitPromote <U >,
715
- U : HasAfEnum + ImplicitPromote <T > + Clone + ConstGenerator <OutType = U >,
707
+ T : ImplicitPromote <U >,
708
+ U : ImplicitPromote <T > + Clone + ConstGenerator <OutType = U >,
716
709
{
717
710
type Output = Array <<T as ImplicitPromote <U >>:: Output >;
718
711
@@ -729,8 +722,8 @@ macro_rules! arith_lhs_scalar_func {
729
722
// Implement (rust_type op_name &Array<T>)
730
723
impl <' f, T > $op_name<& ' f Array <T >> for $rust_type
731
724
where
732
- T : HasAfEnum + ImplicitPromote <$rust_type>,
733
- $rust_type: HasAfEnum + ImplicitPromote <T >,
725
+ T : ImplicitPromote <$rust_type>,
726
+ $rust_type: ImplicitPromote <T >,
734
727
{
735
728
type Output = Array <<$rust_type as ImplicitPromote <T >>:: Output >;
736
729
@@ -742,8 +735,8 @@ macro_rules! arith_lhs_scalar_func {
742
735
// Implement (rust_type op_name Array<T>)
743
736
impl <T > $op_name<Array <T >> for $rust_type
744
737
where
745
- T : HasAfEnum + ImplicitPromote <$rust_type>,
746
- $rust_type: HasAfEnum + ImplicitPromote <T >,
738
+ T : ImplicitPromote <$rust_type>,
739
+ $rust_type: ImplicitPromote <T >,
747
740
{
748
741
type Output = Array <<$rust_type as ImplicitPromote <T >>:: Output >;
749
742
@@ -782,9 +775,8 @@ macro_rules! arith_func {
782
775
( $op_name: ident, $fn_name: ident, $delegate: ident) => {
783
776
impl <A , B > $op_name<Array <B >> for Array <A >
784
777
where
785
- A : HasAfEnum + ImplicitPromote <B >,
786
- B : HasAfEnum + ImplicitPromote <A >,
787
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
778
+ A : ImplicitPromote <B >,
779
+ B : ImplicitPromote <A >,
788
780
{
789
781
type Output = Array <<A as ImplicitPromote <B >>:: Output >;
790
782
@@ -795,9 +787,8 @@ macro_rules! arith_func {
795
787
796
788
impl <' a, A , B > $op_name<& ' a Array <B >> for Array <A >
797
789
where
798
- A : HasAfEnum + ImplicitPromote <B >,
799
- B : HasAfEnum + ImplicitPromote <A >,
800
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
790
+ A : ImplicitPromote <B >,
791
+ B : ImplicitPromote <A >,
801
792
{
802
793
type Output = Array <<A as ImplicitPromote <B >>:: Output >;
803
794
@@ -808,9 +799,8 @@ macro_rules! arith_func {
808
799
809
800
impl <' a, A , B > $op_name<Array <B >> for & ' a Array <A >
810
801
where
811
- A : HasAfEnum + ImplicitPromote <B >,
812
- B : HasAfEnum + ImplicitPromote <A >,
813
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
802
+ A : ImplicitPromote <B >,
803
+ B : ImplicitPromote <A >,
814
804
{
815
805
type Output = Array <<A as ImplicitPromote <B >>:: Output >;
816
806
@@ -821,9 +811,8 @@ macro_rules! arith_func {
821
811
822
812
impl <' a, ' b, A , B > $op_name<& ' a Array <B >> for & ' b Array <A >
823
813
where
824
- A : HasAfEnum + ImplicitPromote <B >,
825
- B : HasAfEnum + ImplicitPromote <A >,
826
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
814
+ A : ImplicitPromote <B >,
815
+ B : ImplicitPromote <A >,
827
816
{
828
817
type Output = Array <<A as ImplicitPromote <B >>:: Output >;
829
818
@@ -849,9 +838,8 @@ macro_rules! bitshift_scalar_func {
849
838
( $rust_type: ty, $trait_name: ident, $op_name: ident) => {
850
839
impl <T > $trait_name<$rust_type> for Array <T >
851
840
where
852
- T : HasAfEnum + ImplicitPromote <$rust_type>,
853
- $rust_type: HasAfEnum + ImplicitPromote <T >,
854
- <T as ImplicitPromote <$rust_type>>:: Output : HasAfEnum ,
841
+ T : ImplicitPromote <$rust_type>,
842
+ $rust_type: ImplicitPromote <T >,
855
843
{
856
844
type Output = Array <<T as ImplicitPromote <$rust_type>>:: Output >;
857
845
@@ -862,9 +850,8 @@ macro_rules! bitshift_scalar_func {
862
850
}
863
851
impl <' f, T > $trait_name<$rust_type> for & ' f Array <T >
864
852
where
865
- T : HasAfEnum + ImplicitPromote <$rust_type>,
866
- $rust_type: HasAfEnum + ImplicitPromote <T >,
867
- <T as ImplicitPromote <$rust_type>>:: Output : HasAfEnum ,
853
+ T : ImplicitPromote <$rust_type>,
854
+ $rust_type: ImplicitPromote <T >,
868
855
{
869
856
type Output = Array <<T as ImplicitPromote <$rust_type>>:: Output >;
870
857
@@ -900,10 +887,8 @@ mod op_assign {
900
887
( $op_name: ident, $fn_name: ident, $func: ident) => {
901
888
impl <A , B > $op_name<Array <B >> for Array <A >
902
889
where
903
- A : HasAfEnum + ImplicitPromote <B >,
904
- B : HasAfEnum + ImplicitPromote <A >,
905
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
906
- <B as ImplicitPromote <A >>:: Output : HasAfEnum ,
890
+ A : ImplicitPromote <B >,
891
+ B : ImplicitPromote <A >,
907
892
{
908
893
fn $fn_name( & mut self , rhs: Array <B >) {
909
894
let tmp_seq = Seq :: <f32 >:: default ( ) ;
@@ -930,10 +915,8 @@ mod op_assign {
930
915
( $rust_type: ty, $trait_name: ident, $op_name: ident, $func: ident) => {
931
916
impl <T > $trait_name<$rust_type> for Array <T >
932
917
where
933
- $rust_type: HasAfEnum + ImplicitPromote <T >,
934
- T : HasAfEnum
935
- + ImplicitPromote <$rust_type>
936
- + ImplicitPromote <$rust_type, Output = T >,
918
+ $rust_type: ImplicitPromote <T >,
919
+ T : ImplicitPromote <$rust_type, Output = T >,
937
920
{
938
921
fn $op_name( & mut self , rhs: $rust_type) {
939
922
let mut temp = $func( self , & rhs, false ) ;
@@ -959,10 +942,8 @@ mod op_assign {
959
942
( $op_name: ident, $fn_name: ident, $func: ident) => {
960
943
impl <A , B > $op_name<Array <B >> for Array <A >
961
944
where
962
- A : HasAfEnum + ImplicitPromote <B >,
963
- B : HasAfEnum + ImplicitPromote <A >,
964
- <A as ImplicitPromote <B >>:: Output : HasAfEnum ,
965
- <B as ImplicitPromote <A >>:: Output : HasAfEnum ,
945
+ A : ImplicitPromote <B >,
946
+ B : ImplicitPromote <A >,
966
947
{
967
948
fn $fn_name( & mut self , rhs: Array <B >) {
968
949
let tmp_seq = Seq :: <f32 >:: default ( ) ;
@@ -985,13 +966,9 @@ mod op_assign {
985
966
///Implement negation trait for Array
986
967
impl < T > Neg for Array < T >
987
968
where
988
- T : HasAfEnum + Zero + ConstGenerator ,
989
- <T as ConstGenerator >:: OutType : HasAfEnum ,
990
- <T as ConstGenerator >:: OutType : ImplicitPromote < T > ,
991
- T : ImplicitPromote < <T as ConstGenerator >:: OutType > ,
992
- <<T as ConstGenerator >:: OutType as ImplicitPromote < T > >:: Output : HasAfEnum ,
969
+ T : Zero + ConstGenerator < OutType = T > ,
993
970
{
994
- type Output = Array < << T as ConstGenerator > :: OutType as ImplicitPromote < T > > :: Output > ;
971
+ type Output = Array < T > ;
995
972
996
973
fn neg ( self ) -> Self :: Output {
997
974
let cnst = constant ( T :: zero ( ) , self . dims ( ) ) ;
0 commit comments