@@ -12,12 +12,97 @@ mod thrust_models {
1212 #[ thrust:: def:: int_model]
1313 pub struct Int ;
1414
15+ impl < T > PartialEq < T > for Int where T : super :: Model < Ty = Self > {
16+ #[ thrust:: ignored]
17+ fn eq ( & self , _other : & T ) -> bool {
18+ unimplemented ! ( )
19+ }
20+ }
21+
22+ impl < T > PartialOrd < T > for Int where T : super :: Model < Ty = Self > {
23+ #[ thrust:: ignored]
24+ fn partial_cmp ( & self , _other : & T ) -> Option < std:: cmp:: Ordering > {
25+ unimplemented ! ( )
26+ }
27+ }
28+
29+ impl < T > std:: ops:: Add < T > for Int where T : super :: Model < Ty = Self > {
30+ type Output = Self ;
31+
32+ #[ thrust:: ignored]
33+ fn add ( self , _rhs : T ) -> Self :: Output {
34+ unimplemented ! ( )
35+ }
36+ }
37+
38+ impl < T > std:: ops:: Sub < T > for Int where T : super :: Model < Ty = Self > {
39+ type Output = Self ;
40+
41+ #[ thrust:: ignored]
42+ fn sub ( self , _rhs : T ) -> Self :: Output {
43+ unimplemented ! ( )
44+ }
45+ }
46+
47+ impl < T > std:: ops:: Mul < T > for Int where T : super :: Model < Ty = Self > {
48+ type Output = Self ;
49+
50+ #[ thrust:: ignored]
51+ fn mul ( self , _rhs : T ) -> Self :: Output {
52+ unimplemented ! ( )
53+ }
54+ }
55+
56+ impl std:: ops:: Neg for Int {
57+ type Output = Self ;
58+
59+ #[ thrust:: ignored]
60+ fn neg ( self ) -> Self :: Output {
61+ unimplemented ! ( )
62+ }
63+ }
64+
1565 #[ thrust:: def:: mut_model]
1666 pub struct Mut < T > ( PhantomData < T > ) ;
1767
68+ impl < T > Mut < T > {
69+ #[ thrust:: def:: mut_new]
70+ pub fn new ( _a : T , _b : T ) -> Self {
71+ unimplemented ! ( )
72+ }
73+ }
74+
75+ impl < T > std:: ops:: Deref for Mut < T > {
76+ type Target = T ;
77+ fn deref ( & self ) -> & Self :: Target {
78+ unimplemented ! ( )
79+ }
80+ }
81+
82+ impl < T > std:: ops:: Not for Mut < T > {
83+ type Output = T ;
84+ fn not ( self ) -> Self :: Output {
85+ unimplemented ! ( )
86+ }
87+ }
88+
1889 #[ thrust:: def:: box_model]
1990 pub struct Box < T > ( PhantomData < T > ) ;
2091
92+ impl < T > Box < T > {
93+ #[ thrust:: def:: box_new]
94+ pub fn new ( _x : T ) -> Self {
95+ unimplemented ! ( )
96+ }
97+ }
98+
99+ impl < T > std:: ops:: Deref for Box < T > {
100+ type Target = T ;
101+ fn deref ( & self ) -> & Self :: Target {
102+ unimplemented ! ( )
103+ }
104+ }
105+
21106 #[ thrust:: def:: array_model]
22107 pub struct Array < I , T > ( PhantomData < I > , PhantomData < T > ) ;
23108
@@ -27,6 +112,10 @@ mod thrust_models {
27112 pub struct Vec < T > ( pub Array < Int , T > , pub usize ) ;
28113 }
29114
115+ impl Model for model:: Int {
116+ type Ty = model:: Int ;
117+ }
118+
30119 impl Model for isize {
31120 type Ty = model:: Int ;
32121 }
@@ -75,6 +164,10 @@ mod thrust_models {
75164 type Ty = ( <T0 as Model >:: Ty , <T1 as Model >:: Ty , <T2 as Model >:: Ty ) ;
76165 }
77166
167+ impl < T0 , T1 , T2 , T3 > Model for ( T0 , T1 , T2 , T3 ) where T0 : Model , T1 : Model , T2 : Model , T3 : Model {
168+ type Ty = ( <T0 as Model >:: Ty , <T1 as Model >:: Ty , <T2 as Model >:: Ty , <T3 as Model >:: Ty ) ;
169+ }
170+
78171 impl < ' a , T > Model for & ' a mut T where T : Model {
79172 type Ty = model:: Mut < <T as Model >:: Ty > ;
80173 }
0 commit comments